From: Cristy Date: Fri, 6 May 2016 14:03:01 +0000 (-0400) Subject: Avoid overflow when parsing PSD resource blocks X-Git-Tag: 7.0.1-2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15dd190dfd7e7a3341bdc378f4f0daba9873322c;p=imagemagick Avoid overflow when parsing PSD resource blocks --- diff --git a/coders/psd.c b/coders/psd.c index b26513c0f..eb107f47e 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -643,7 +643,7 @@ static void ParseImageResourceBlocks(Image *image, p=PushShortPixel(MSBEndian,p,&id); p=PushShortPixel(MSBEndian,p,&short_sans); p=PushLongPixel(MSBEndian,p,&count); - if (p+count > blocks+length) + if ((p+count) > (blocks+length-16)) return; switch (id) {