File ImageMagick-CVE-2016-7530.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/magick/quantum.c
===================================================================
--- ImageMagick-6.8.8-1.orig/magick/quantum.c	2016-09-27 10:11:01.618620207 +0200
+++ ImageMagick-6.8.8-1/magick/quantum.c	2016-09-27 10:11:01.706621621 +0200
@@ -687,8 +689,9 @@ MagickExport MagickBooleanType SetQuantu
   if (quantum_info->pixels != (unsigned char **) NULL)
     DestroyQuantumPixels(quantum_info);
   quantum=(quantum_info->pad+6)*(quantum_info->depth+7)/8;
-  extent=image->columns*quantum;
-  if (quantum != (extent/image->columns))
+  extent=MagickMax(image->columns,image->rows)*quantum;
+  if ((MagickMax(image->columns,image->rows) != 0) &&
+      (quantum != (extent/MagickMax(image->columns,image->rows))))
     return(MagickFalse);
   return(AcquireQuantumPixels(quantum_info,extent));
 }