File ImageMagick-6.8.6.9-CVE-2014-1958.patch of Package ImageMagick.openSUSE_13.1_Update

http://trac.imagemagick.org/changeset/14801
Index: coders/psd.c
===================================================================
--- coders/psd.c
+++ coders/psd.c
@@ -330,5 +330,5 @@
   for (i=0; (packets > 1) && (i < (ssize_t) number_pixels); )
   {
-    length=(*compact_pixels++);
+    length=(size_t) (*compact_pixels++);
     packets--;
     if (length == 128)
@@ -337,4 +337,6 @@
       {
         length=256-length+1;
+        if ((ssize_t) length + i > (ssize_t) number_pixels)
+          length=number_pixels-(size_t) i;
         pixel=(*compact_pixels++);
         packets--;
@@ -383,4 +385,6 @@
       }
     length++;
+    if ((ssize_t) length + i > (ssize_t) number_pixels)
+      length=number_pixels-(size_t) i;
     for (j=0; j < (ssize_t) length; j++)
     {
openSUSE Build Service is sponsored by