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];