diff --git a/src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs b/src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs index a90f9cb8e..f97e085d5 100644 --- a/src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs +++ b/src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs @@ -413,6 +413,11 @@ namespace ImageProcessorCore.Formats return null; } + if (chunk.Length <= 0) + { + return null; + } + byte[] typeBuffer = this.ReadChunkType(chunk); this.ReadChunkData(chunk);