From: dirk Date: Fri, 26 Aug 2016 16:11:37 +0000 (+0200) Subject: Fixed removing the ICC profile from the 8BIM profile. X-Git-Tag: 7.0.2-10~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c4777c310806a6bd8cbeae0b7c4e118c528e330;p=imagemagick Fixed removing the ICC profile from the 8BIM profile. --- diff --git a/coders/psd.c b/coders/psd.c index b96b405d5..4d8284154 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -2586,9 +2586,10 @@ static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) quantum; quantum=PSDQuantum(count)+12; - if ((quantum >= 12) && (q+quantum < (datum+length-16))) + if ((quantum >= 12) && (quantum < length)) { - (void) CopyMagickMemory(q,q+quantum,length-quantum-(q-datum)); + if ((q+quantum < (datum+length-16))) + (void) CopyMagickMemory(q,q+quantum,length-quantum-(q-datum)); SetStringInfoLength(bim_profile,length-quantum); } break;