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."); }