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

From b6ae2f9e0ab13343c0281732d479757a8e8979c7 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Sat, 30 Jan 2016 10:20:32 -0500
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/102

---
 coders/wpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: ImageMagick-6.8.9-8/coders/wpg.c
===================================================================
--- ImageMagick-6.8.9-8.orig/coders/wpg.c	2016-09-29 11:12:05.151026354 +0200
+++ ImageMagick-6.8.9-8/coders/wpg.c	2016-09-29 11:12:05.215027379 +0200
@@ -325,7 +325,7 @@ static void InsertRow(unsigned char *p,s
         if (q == (PixelPacket *) NULL)
           break;
         indexes=GetAuthenticIndexQueue(image);
-        for (x=0; x < ((ssize_t) image->columns-1); x+=2)
+        for (x=0; x < ((ssize_t) image->columns-3); x+=4)
         {
             index=ConstrainColormapIndex(image,(*p >> 6) & 0x3);
             SetPixelIndex(indexes+x,index);
@@ -351,15 +351,13 @@ static void InsertRow(unsigned char *p,s
             SetPixelIndex(indexes+x,index);
             SetPixelRGBO(q,image->colormap+(ssize_t) index);
             q++;
-            if ((image->columns % 4) >= 1)
-
+            if ((image->columns % 4) > 1)
               {
                 index=ConstrainColormapIndex(image,(*p >> 4) & 0x3);
                 SetPixelIndex(indexes+x,index);
                 SetPixelRGBO(q,image->colormap+(ssize_t) index);
                 q++;
-                if ((image->columns % 4) >= 2)
-
+                if ((image->columns % 4) > 2)
                   {
                     index=ConstrainColormapIndex(image,(*p >> 2) & 0x3);
                     SetPixelIndex(indexes+x,index);
@@ -1203,7 +1200,7 @@ static Image *ReadWPGImage(const ImageIn
               if (image->next == (Image *) NULL)
                 goto Finish;
               image=SyncNextImageInList(image);
-              image->columns=image->rows=0;
+              image->columns=image->rows=1;
               image->colors=0;
               break;