]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 1 Sep 2011 13:28:16 +0000 (13:28 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 1 Sep 2011 13:28:16 +0000 (13:28 +0000)
coders/jp2.c

index df08503421eaf557d6d65d8549df22cf2c5ff619..2835152b882170cba9ce64aeedc6d511ab89e978 100644 (file)
@@ -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);