From: cristy Date: Thu, 1 Sep 2011 13:28:16 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9631d121de57d064eafa6db3e97aee98c28c64db;p=imagemagick --- diff --git a/coders/jp2.c b/coders/jp2.c index df0850342..2835152b8 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -617,8 +617,9 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Profile: ICC, %.20g bytes",(double) blob->len_); - profile=AcquireStringInfo(blob->len_); - SetStringInfoDatum(profile,blob->buf_); + profile=BlobToStringInfo(blob->buf_,blob->len_); + if (profile == (StringInfo *) NULL) + ThrowReaderException(CorruptImageError,"MemoryAllocationFailed"); icc_profile=(StringInfo *) GetImageProfile(image,"icc"); if (icc_profile == (StringInfo *) NULL) (void) SetImageProfile(image,"icc",profile);