avoid dropping final frame of audio data due to wrong test

This commit is contained in:
Sean Barrett
2016-04-02 04:20:36 -07:00
parent 7a694bdcca
commit b03133000a
2 changed files with 29 additions and 1 deletions

View File

@ -3508,7 +3508,7 @@ static int is_whole_packet_present(stb_vorbis *f, int end_page)
}
// either this continues, or it ends it...
if (end_page)
if (s < f->segment_count-1) return error(f, VORBIS_invalid_stream);
if (s < f->segment_count) return error(f, VORBIS_invalid_stream);
if (s == f->segment_count)
s = -1; // set 'crosses page' flag
if (p > f->stream_end) return error(f, VORBIS_need_more_data);