From 94c2e0b7973fe31c42c16670e258fa40e1b6109a Mon Sep 17 00:00:00 2001 From: dirk Date: Sun, 29 May 2016 08:15:20 +0200 Subject: [PATCH] Added check for invalid number of frames. --- coders/mat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); } -- 2.40.0