From 6745cae8b6b425f0969d2ac551316164daa3f347 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 24 Oct 2022 22:02:35 +1100 Subject: [PATCH] Update src/ImageSharp/Formats/Png/PngEncoderCore.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Günther Foidl --- src/ImageSharp/Formats/Png/PngEncoderCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index 70dd73b938..9440e51b0f 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -1336,7 +1336,7 @@ internal sealed class PngEncoderCore : IImageEncoderInternals, IDisposable bitDepth = bits; } - if (Array.IndexOf(PngConstants.ColorTypes[colorType], bitDepth) == -1) + if (Array.IndexOf(PngConstants.ColorTypes[colorType], bitDepth) < 0) { throw new NotSupportedException("Bit depth is not supported or not valid."); }