From e6239727a0f41ac988e5ada1ca3a88f33f21791e Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 28 Aug 2017 23:13:41 +0200 Subject: [PATCH] Added missing clear for the previousScanline when going to the next pass --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 633d151b6..f58322ee5 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -515,7 +515,7 @@ namespace ImageSharp.Formats this.currentRowBytesRead = 0; Span scanSpan = this.scanline.Slice(0, bytesPerInterlaceScanline); - Span prevSpan = this.previousScanline.Span.Slice(0, bytesPerInterlaceScanline); + Span prevSpan = this.previousScanline.Slice(0, bytesPerInterlaceScanline); var filterType = (FilterType)scanSpan[0]; switch (filterType) @@ -556,6 +556,8 @@ namespace ImageSharp.Formats } this.pass++; + this.previousScanline.Clear(); + if (this.pass < 7) { this.currentRow = Adam7FirstRow[this.pass];