From: dirk Date: Sun, 29 May 2016 06:15:20 +0000 (+0200) Subject: Added check for invalid number of frames. X-Git-Tag: 7.0.1-7~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94c2e0b7973fe31c42c16670e258fa40e1b6109a;p=imagemagick Added check for invalid number of frames. --- diff --git a/coders/mat.c b/coders/mat.c index 462bd530e..7987dd0e8 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -939,7 +939,9 @@ MATLAB_KO: ThrowReaderException(CorruptImageError,"ImproperImageHeader"); case 16: z2=z = ReadBlobXXXLong(image2); /* 4D matrix animation */ if(z!=3 && z!=1) ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported"); - Frames = ReadBlobXXXLong(image2); + Frames = ReadBlobXXXLong(image2); + if (Frames == 0) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); break; default: ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported"); }