File ImageMagick-CVE-2018-16413.patch of Package ImageMagick.8831

Index: ImageMagick-6.8.8-1/coders/psd.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/psd.c	2018-09-05 13:36:29.553794752 +0200
+++ ImageMagick-6.8.8-1/coders/psd.c	2018-09-05 13:37:24.282162749 +0200
@@ -778,7 +778,7 @@ static void ParseImageResourceBlocks(Ima
     if (p > (blocks+length-4))
       return;
     p=PushLongPixel(MSBEndian,p,&count);
-    if ((p+count) > (blocks+length))
+    if (((p+count) < blocks) || ((p+count) > (blocks+length)))
       return;
     switch (id)
     {
openSUSE Build Service is sponsored by