From d74443932d70f53cad92e3d5898e918633918a36 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 1 Apr 2018 13:21:34 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7017 --- coders/mat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/coders/mat.c b/coders/mat.c index 28f1baa49..3d797306e 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -686,6 +686,8 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, } image->columns=(size_t) HDR.nRows; image->rows=(size_t) HDR.nCols; + if ((image->columns == 0) || (image->rows == 0)) + return(image); if (image_info->ping != MagickFalse) { Swap(image->columns,image->rows); @@ -938,9 +940,6 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) image->endian = MSBEndian; } else - goto MATLAB_KO; /* unsupported endian */ - - if (strncmp(MATLAB_HDR.identific, "MATLAB", 6)) { MATLAB_KO: if ((image != image2) && (image2 != (Image *) NULL)) -- 2.40.0