diff --git a/src/coding/ogg_vorbis_decoder.c b/src/coding/ogg_vorbis_decoder.c index 5ca7f47d..198d14aa 100644 --- a/src/coding/ogg_vorbis_decoder.c +++ b/src/coding/ogg_vorbis_decoder.c @@ -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); } diff --git a/src/streamfile.c b/src/streamfile.c index 6ce19f75..bf1228cf 100644 --- a/src/streamfile.c +++ b/src/streamfile.c @@ -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; }