Permalink
Browse files

#148

  • Loading branch information...
Cristy
Cristy committed Mar 12, 2016
1 parent c57a4dc commit 53c1dcd34bed85181b901bfce1a2322f85a59472
Showing with 6 additions and 3 deletions.
  1. +6 −3 coders/psd.c
View
@@ -2542,9 +2542,12 @@ static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile)
p=PushLongPixel(MSBEndian,p,&count);
if (id == 0x0000040f)
{
- (void) CopyMagickMemory(q,q+PSDQuantum(count)+12,length-
- (PSDQuantum(count)+12)-(q-datum));
- SetStringInfoLength(bim_profile,length-(PSDQuantum(count)+12));
+ if ((q+PSDQuantum(count)+12) < (datum+length-16))
+ {
+ (void) CopyMagickMemory(q,q+PSDQuantum(count)+12,length-
+ (PSDQuantum(count)+12)-(q-datum));
+ SetStringInfoLength(bim_profile,length-(PSDQuantum(count)+12));
+ }
break;
}
p+=count;

0 comments on commit 53c1dcd

Please sign in to comment.