File ImageMagick-CVE-2017-11537.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/palm.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/palm.c	2018-01-31 14:23:21.243175822 +0100
+++ ImageMagick-6.8.8-1/coders/palm.c	2018-01-31 14:23:21.251175960 +0100
@@ -759,10 +759,11 @@ static MagickBooleanType WritePALMImage(
       (void) TransformImageColorspace(image,sRGBColorspace);
     count=GetNumberColors(image,NULL,&exception);
     for (bits_per_pixel=1;  (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
-    if (image_info->depth > 100)
-      bits_per_pixel=image_info->depth-100;
-    if (bits_per_pixel < 16)
-      (void) TransformImageColorspace(image,image->colorspace);
+    if (bits_per_pixel > 16)
+      bits_per_pixel=16;
+    else
+      if (bits_per_pixel < 16)
+        (void) TransformImageColorspace(image,image->colorspace);
     if (bits_per_pixel < 8)
       {
         (void) TransformImageColorspace(image,GRAYColorspace);