if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Reading PNG iCCP chunk.");
- profile=AcquireStringInfo(profile_length);
+ profile=BlobToStringInfo(info,profile_length);
+ if (profile == (StringInfo *) NULL)
+ {
+ (void) ThrowMagickException(&image->exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",
+ "unable to copy profile");
+ return(MagickFalse);
+ }
SetStringInfoDatum(profile,(const unsigned char *) info);
(void) SetImageProfile(image,"icc",profile);
profile=DestroyStringInfo(profile);
if (length < 4)
return(MagickFalse);
}
- profile=AcquireStringInfo((size_t) length);
- SetStringInfoDatum(profile,datum+i);
+ profile=BlobToStringInfo(datum+i,(size_t) length);
+ if (profile == (StringInfo *) NULL)
+ ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ image->filename);
status=SetImageProfile(image,name,profile);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)