Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug when seeking to pos < dataoffset #71

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/vorbisfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,12 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
ogg_int64_t best=-1;
int got_page=0;

ogg_int64_t initialBegin;
ogg_page og;


if (pos < begin) begin = pos;
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 +1564,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