Browse Source

Update src/ImageSharp/IO/BufferedReadStream.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/2267/head
James Jackson-South 4 years ago
committed by GitHub
parent
commit
544c14d121
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/ImageSharp/IO/BufferedReadStream.cs

2
src/ImageSharp/IO/BufferedReadStream.cs

@ -172,7 +172,7 @@ internal sealed class BufferedReadStream : Stream
// Too big for remaining buffer but less than entire buffer length
// Copy to buffer then read from there.
if (this.readBufferIndex < 0 || (count + this.readBufferIndex > this.BufferSize))
if (this.readBufferIndex < 0 || (this.readBufferIndex > this.BufferSize - count))
{
return this.ReadToBufferViaCopySlow(buffer);
}

Loading…
Cancel
Save