diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 84909e0488..91578aede6 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -340,10 +340,7 @@ namespace ImageSharp.Formats byte[] scanline = ArrayPool.Shared.Rent(this.bytesPerScanline); // Zero out the previousScanline, because the bytes that are rented from the arraypool may not be zero. - for (var i = 0; i < bytesPerScanline; i++) - { - previousScanline[i] = 0x00; - } + Array.Clear(previousScanline, 0, this.bytesPerScanline); try {