Minor tweaks

This commit is contained in:
bnnm 2019-08-15 22:15:37 +02:00
parent 3f45b62117
commit a3296cd274
2 changed files with 4 additions and 1 deletions

View File

@ -99,6 +99,7 @@ void reset_ogg_vorbis(VGMSTREAM *vgmstream) {
ogg_vorbis_codec_data *data = vgmstream->codec_data;
if (!data) return;
/* this seek cleans internal buffers */
ov_pcm_seek(&data->ogg_vorbis_file, 0);
}
@ -106,6 +107,8 @@ void seek_ogg_vorbis(VGMSTREAM *vgmstream, int32_t num_sample) {
ogg_vorbis_codec_data *data = vgmstream->codec_data;
if (!data) return;
/* this seek crosslaps to avoid possible clicks, so seeking to 0 will
* decode a bit differently than ov_pcm_seek */
ov_pcm_seek_lap(&data->ogg_vorbis_file, num_sample);
}

View File

@ -890,7 +890,7 @@ size_t read_string(char * buf, size_t maxsize, off_t offset, STREAMFILE *streamF
if (buf) buf[pos] = '\0';
return maxsize;
}
if (c < 0x20 || c > 0xA5)
if (c < 0x20 || (uint8_t)c > 0xA5)
goto fail;
}