From 771c739a90dd404c032a22d3943cbf85dad3008a Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Fri, 25 Aug 2017 13:54:38 +1000 Subject: [PATCH] Fix png decode span bug on Core 2.0 --- 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 d9df44a09..633d151b6 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -272,7 +272,7 @@ namespace ImageSharp.Formats /// is less than or equals than zero. private static Span ToArrayByBitsLength(Span source, int bytesPerScanline, int bits) { - Guard.NotNull(source, nameof(source)); + Guard.MustBeGreaterThan(source.Length, 0, nameof(source)); Guard.MustBeGreaterThan(bits, 0, nameof(bits)); if (bits >= 8)