From 5b8077bfe04f4acda09326598783d69b56e462c6 Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Thu, 21 Sep 2017 12:29:23 +1000 Subject: [PATCH] Fix #345 --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 4fd57c278..3bca4b261 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -301,7 +301,7 @@ namespace SixLabors.ImageSharp.Formats.Png int mask = 0xFF >> (8 - bits); int resultOffset = 0; - for (int i = 0; i < bytesPerScanline; i++) + for (int i = 0; i < bytesPerScanline - 1; i++) { byte b = source[i]; for (int shift = 0; shift < 8; shift += bits)