From 436f1780316eed557087c6fcf83f2713fcdd61f6 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 18 Apr 2018 17:53:57 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7763 --- coders/miff.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coders/miff.c b/coders/miff.c index f7f7c5f84..5f8a41900 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -1574,6 +1574,9 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, if (length == 0) { count=ReadBlob(image,packet_size,pixels); + if (count != packet_size) + ThrowReaderException(CorruptImageError, + "UnableToReadImageData"); PushRunlengthPacket(image,pixels,&length,&pixel,exception); } length--; @@ -1596,6 +1599,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, default: { count=ReadBlob(image,packet_size*image->columns,pixels); + if (count != (packet_size*image->columns)) + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, quantum_type,pixels,exception); break; -- 2.40.0