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

diff --git a/coders/psd.c b/coders/psd.c
index 444e8e179..f63120f6b 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -750,7 +750,7 @@ static StringInfo *ParseImageResourceBlocks(Image *image,
     if (p > (blocks+length-4))
       break;
     p=PushLongPixel(MSBEndian,p,&count);
-    if ((p+count) > (blocks+length))
+    if (((p+count) < blocks) || ((p+count) > (blocks+length)))
       break;
     switch (id)
     {

openSUSE Build Service is sponsored by