From 3f534b1b15c9560b89972bf891a5be6b29b1e55c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 16 Aug 2020 23:04:28 +0100 Subject: [PATCH] Update ChunkedMemoryStream.cs --- src/ImageSharp/IO/ChunkedMemoryStream.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/IO/ChunkedMemoryStream.cs b/src/ImageSharp/IO/ChunkedMemoryStream.cs index 798ebbdd5d..d3e6861d28 100644 --- a/src/ImageSharp/IO/ChunkedMemoryStream.cs +++ b/src/ImageSharp/IO/ChunkedMemoryStream.cs @@ -254,7 +254,7 @@ namespace SixLabors.ImageSharp.IO this.readOffset = 0; } - byte[] chunkBuffer = this.writeChunk.Buffer.Array; + byte[] chunkBuffer = this.readChunk.Buffer.Array; int chunkSize = this.readChunk.Length; if (this.readChunk.Next is null) { @@ -275,7 +275,7 @@ namespace SixLabors.ImageSharp.IO this.readChunk = this.readChunk.Next; this.readOffset = 0; - chunkBuffer = this.writeChunk.Buffer.Array; + chunkBuffer = this.readChunk.Buffer.Array; chunkSize = this.readChunk.Length; if (this.readChunk.Next is null) { @@ -310,7 +310,7 @@ namespace SixLabors.ImageSharp.IO this.readOffset = 0; } - byte[] chunkBuffer = this.writeChunk.Buffer.Array; + byte[] chunkBuffer = this.readChunk.Buffer.Array; int chunkSize = this.readChunk.Length; if (this.readChunk.Next is null) { @@ -327,7 +327,7 @@ namespace SixLabors.ImageSharp.IO this.readChunk = this.readChunk.Next; this.readOffset = 0; - chunkBuffer = this.writeChunk.Buffer.Array; + chunkBuffer = this.readChunk.Buffer.Array; } return chunkBuffer[this.readOffset++]; @@ -497,7 +497,7 @@ namespace SixLabors.ImageSharp.IO { Buffer = buffer, Next = null, - Length = this.chunkLength + Length = buffer.Length() }; }