File GraphicsMagick-CVE-2016-10069.patch of Package GraphicsMagick.6323

From 8a370f9ab120faf182aa160900ba692ba8e2bcf0 Mon Sep 17 00:00:00 2001
From: dirk <dirk@git.imagemagick.org>
Date: Sun, 29 May 2016 08:15:48 +0200
Subject: [PATCH] Added check for invalid number of frames.

---
 coders/mat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: GraphicsMagick-1.3.21/coders/mat.c
===================================================================
--- GraphicsMagick-1.3.21.orig/coders/mat.c	2017-01-25 17:24:28.094270741 +0100
+++ GraphicsMagick-1.3.21/coders/mat.c	2017-01-25 17:29:49.570758845 +0100
@@ -570,6 +570,8 @@ MATLAB_KO: ThrowReaderException(CorruptI
 	       if(z!=3 && z!=1)
 		 ThrowReaderException(CoderError, MultidimensionalMatricesAreNotSupported, image);
                Frames = ReadBlobXXXLong(image2);
+         if (Frames == 0)
+           ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
 	       break;
       default: ThrowReaderException(CoderError, MultidimensionalMatricesAreNotSupported,
                          image);
openSUSE Build Service is sponsored by