Skip to content

Commit

Permalink
* Check IsContinued in PeekNextPacketInternal()
Browse files Browse the repository at this point in the history
  • Loading branch information
ioctlLR committed Mar 5, 2014
1 parent 21a41b2 commit 91a1511
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions NVorbis/Ogg/OggPacketReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ public bool CanSeek
// This is fast path... don't make the caller wait if we can help it...
public DataPacket GetNextPacket()
{
var packet = (_current = PeekNextPacketInternal());

if (packet.IsContinued) throw new InvalidDataException();

return packet;
return (_current = PeekNextPacketInternal());
}

public DataPacket PeekNextPacket()
Expand All @@ -221,8 +217,6 @@ Packet PeekNextPacketInternal()
if (_current == null)
{
curPacket = _first;

if (curPacket.IsContinued) throw new InvalidDataException("First packet cannot be split between pages!");
}
else
{
Expand All @@ -244,6 +238,7 @@ Packet PeekNextPacketInternal()
// if we're returning a packet, prep is for use
if (curPacket != null)
{
if (curPacket.IsContinued) throw new InvalidDataException("Packet is incomplete!");
curPacket.Reset();
}

Expand Down

0 comments on commit 91a1511

Please sign in to comment.