diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 6f5ea55d9..f8567e45f 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -12,6 +12,8 @@ namespace ImageSharp.Formats using System.Linq; using System.Text; + using static ComparableExtensions; + /// /// Performs the png decoding operation. /// @@ -319,9 +321,7 @@ namespace ImageSharp.Formats this.ProcessDefilteredScanline(scanline, y, pixels); - byte[] temp = previousScanline; - previousScanline = scanline; - scanline = temp; + Swap(ref scanline, ref previousScanline); } } finally