File ImageMagick-CVE-2018-8960.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/tiff.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/tiff.c	2018-04-18 11:20:04.917242246 +0200
+++ ImageMagick-6.8.8-1/coders/tiff.c	2018-04-18 11:21:42.810925660 +0200
@@ -1350,8 +1350,9 @@ RestoreMSCWarning
     if (((MagickSizeType) TIFFScanlineSize(tiff)) > GetBlobSize(image))
       ThrowTIFFException(CorruptImageError,"InsufficientImageDataInFile");
     pixels=(unsigned char *) AcquireMagickMemory(MagickMax(
-      TIFFScanlineSize(tiff),(size_t) (image->columns*samples_per_pixel*
-      pow(2.0,ceil(log(bits_per_sample)/log(2.0)))*sizeof(uint32))));
+      TIFFScanlineSize(tiff),(ssize_t) MagickMax(image->columns*
+      samples_per_pixel*pow(2.0,ceil(log(bits_per_sample)/log(2.0))),
+      rows_per_strip)*sizeof(uint32)));
     if (pixels == (unsigned char *) NULL)
       ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
     switch (method)