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

index ed86961dca32f68c4b0b35b1341c3ee23ead0894..cb3b841f3d80df979336852c609d567b66abbb3d 100644 (file)
@@ -671,7 +671,9 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
       /*
         User defined data.
       */
-      profile=AcquireStringInfo(cin.file.user_length);
+      profile=BlobToStringInfo((const void *) NULL,cin.file.user_length);
+      if (profile == (StringInfo *) NULL)
+        ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
       offset+=ReadBlob(image,GetStringInfoLength(profile),
         GetStringInfoDatum(profile));
       (void) SetImageProfile(image,"dpx:user.data",profile);
index 3309fee5ae2f90f26abe2f3691ed13fa2c488eea..7cb751ae122d5f71bcda9d0dbff0ae8377dc76ee 100644 (file)
@@ -982,7 +982,10 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
           StringInfo
             *profile;
 
-           profile=AcquireStringInfo(dpx.file.user_size-sizeof(dpx.user.id));
+           profile=BlobToStringInfo((const void *) NULL,
+             dpx.file.user_size-sizeof(dpx.user.id));
+           if (profile == (StringInfo *) NULL)
+             ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
            offset+=ReadBlob(image,GetStringInfoLength(profile),
              GetStringInfoDatum(profile));
            (void) SetImageProfile(image,"dpx",profile);