Skip to content

Commit

Permalink
Fixed bug when seeking to pos < dataoffset
Browse files Browse the repository at this point in the history
  • Loading branch information
ed95 committed Aug 13, 2020
1 parent 4a767c9 commit f9cede2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/vorbisfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,10 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
int got_page=0;

ogg_page og;


if (pos < begin) begin = pos;
ogg_int64_t initialBegin = begin;

/* if we have only one page, there will be no bisection. Grab the page here */
if(begin==end){
result=_seek_helper(vf,begin);
Expand Down Expand Up @@ -1560,7 +1563,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
first PCM granule position fencepost. */

if(got_page &&
begin == vf->dataoffsets[link] &&
begin == initialBegin &&
ogg_page_serialno(&og)==vf->serialnos[link]){

/* Yes, this is the beginning-of-stream case. We already have
Expand Down

0 comments on commit f9cede2

Please sign in to comment.