]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 16 Oct 2009 14:04:35 +0000 (14:04 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 16 Oct 2009 14:04:35 +0000 (14:04 +0000)
coders/pict.c
coders/png.c

index c899f3b54bd474d5c580b506596825ff4b6f4e85..65535a8f8254abbef135f3bb4ced778d4fdffd17 100644 (file)
@@ -1692,18 +1692,22 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
     {
       (void) WriteBlobMSBShort(image,0xa1);
       (void) WriteBlobMSBShort(image,0x1f2);
-      (void) WriteBlobMSBShort(image,(unsigned short) (GetStringInfoLength(profile)+4));
+      (void) WriteBlobMSBShort(image,(unsigned short)
+        (GetStringInfoLength(profile)+4));
       (void) WriteBlobString(image,"8BIM");
-      (void) WriteBlob(image,GetStringInfoLength(profile),GetStringInfoDatum(profile));
+      (void) WriteBlob(image,GetStringInfoLength(profile),
+        GetStringInfoDatum(profile));
     }
   profile=GetImageProfile(image,"icc");
   if (profile != (StringInfo *) NULL)
     {
       (void) WriteBlobMSBShort(image,0xa1);
       (void) WriteBlobMSBShort(image,0xe0);
-      (void) WriteBlobMSBShort(image,(unsigned short) (GetStringInfoLength(profile)+4));
+      (void) WriteBlobMSBShort(image,(unsigned short)
+        (GetStringInfoLength(profile)+4));
       (void) WriteBlobMSBLong(image,0x00000000UL);
-      (void) WriteBlob(image,GetStringInfoLength(profile),GetStringInfoDatum(profile));
+      (void) WriteBlob(image,GetStringInfoLength(profile),
+        GetStringInfoDatum(profile));
       (void) WriteBlobMSBShort(image,0xa1);
       (void) WriteBlobMSBShort(image,0xe0);
       (void) WriteBlobMSBShort(image,4);
index e5cdc404eccca8e7e9917eafb6f00ca0cf382f21..c45587b4e1a811459a3ee8ed00452e5e6a6ac79f 100644 (file)
@@ -1712,7 +1712,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
        PNG_LIBPNG_VER_STRING);
 #endif
 
-  quantum_info = NULL;
+  quantum_info = (QuantumInfo *) NULL;
   image=mng_info->image;
 
   /*
@@ -2272,9 +2272,6 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
   /*
     Convert PNG pixels to pixel packets.
   */
-  quantum_info=AcquireQuantumInfo(image_info,image);
-  if (quantum_info == (QuantumInfo *) NULL)
-    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
   if (setjmp(ping->jmpbuf))
     {
       /*
@@ -2299,6 +2296,9 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
         }
       return(GetFirstImageInList(image));
     }
+  quantum_info=AcquireQuantumInfo(image_info,image);
+  if (quantum_info == (QuantumInfo *) NULL)
+    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
   if (image->storage_class == DirectClass)
     for (pass=0; pass < num_passes; pass++)
     {
@@ -6276,6 +6276,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   AcquireSemaphoreInfo(&png_semaphore);
 #endif
 
+  quantum_info = (QuantumInfo *) NULL;
   image_colors=image->colors;
   image_depth=image->depth;
   image_matte=image->matte;
@@ -7407,9 +7408,6 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   /*
     Initialize image scanlines.
   */
-  quantum_info=AcquireQuantumInfo(image_info,image);
-  if (quantum_info == (QuantumInfo *) NULL)
-    ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
   if (setjmp(ping->jmpbuf))
     {
       /*
@@ -7429,6 +7427,9 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 #endif
       return(MagickFalse);
     }
+  quantum_info=AcquireQuantumInfo(image_info,image);
+  if (quantum_info == (QuantumInfo *) NULL)
+    ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
   quantum_info->format=UndefinedQuantumFormat;
   quantum_info->depth=image_depth;
   num_passes=png_set_interlace_handling(ping);