Skip to content

Commit

Permalink
* BugFix: copyOffset might be larger than the original buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
ioctlLR committed Mar 5, 2014
1 parent a97634f commit e69e2d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NVorbis/StreamReadBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void EnsureBufferSize(int reqSize, bool copyContents, int copyOffset)
// be clever... if we're moving to a new buffer or the ranges don't overlap, just use a block copy
if (newBuf != _data || _end <= -copyOffset)
{
Buffer.BlockCopy(_data, 0, newBuf, -copyOffset, Math.Min(_end, _data.Length + copyOffset));
Buffer.BlockCopy(_data, 0, newBuf, -copyOffset, Math.Max(_end, Math.Min(_end, _data.Length + copyOffset)));
}
else
{
Expand Down

0 comments on commit e69e2d0

Please sign in to comment.