Skip to content

Commit

Permalink
* Fix early termination of packet reader
Browse files Browse the repository at this point in the history
  • Loading branch information
ioctlLR committed Mar 31, 2014
1 parent 0c8b03f commit 5f6b4a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions NVorbis/Ogg/OggContainerReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ bool AddPage(PageHeader hdr)
// get our flags prepped
var isContinued = false;
var isContinuation = (hdr.Flags & PageFlags.ContinuesPacket) == PageFlags.ContinuesPacket;
var isEOS = (hdr.Flags & PageFlags.EndOfStream) == PageFlags.EndOfStream;
var isEOS = false;
var isResync = hdr.IsResync;

// add all the packets, making sure to update flags as needed
Expand All @@ -391,10 +391,11 @@ bool AddPage(PageHeader hdr)
isContinuation = false;
isResync = false;

// only the last packet in a page can be continued
// only the last packet in a page can be continued or flagged end of stream
if (--cnt == 1)
{
isContinued = hdr.LastPacketContinues;
isEOS = (hdr.Flags & PageFlags.EndOfStream) == PageFlags.EndOfStream;
}
}

Expand Down

0 comments on commit 5f6b4a2

Please sign in to comment.