]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 25 Jan 2014 23:59:50 +0000 (23:59 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 25 Jan 2014 23:59:50 +0000 (23:59 +0000)
MagickCore/blob.c

index cf6e8b49c9ddc099fad03ec7b3c1ebfe8b85d588..ba6741271b82a7b18a0d278276aece101429cc95 100644 (file)
@@ -1536,8 +1536,8 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info,
         Native blob support for this image format.
       */
       blob_info->length=0;
-      blob_info->blob=(void *) AcquireQuantumMemory(MagickMaxBlobExtent,
-        sizeof(unsigned char));
+      blob_info->blob=(void *) AcquireQuantumMemory(image->columns,
+        image->rows*sizeof(unsigned char));
       if (blob_info->blob == (void *) NULL)
         (void) ThrowMagickException(exception,GetMagickModule(),
           ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
@@ -1791,8 +1791,8 @@ MagickExport unsigned char *ImagesToBlob(const ImageInfo *image_info,
         Native blob support for this images format.
       */
       blob_info->length=0;
-      blob_info->blob=(void *) AcquireQuantumMemory(MagickMaxBlobExtent,
-        sizeof(unsigned char));
+      blob_info->blob=(void *) AcquireQuantumMemory(images->columns,
+        images->rows*sizeof(unsigned char));
       if (blob_info->blob == (void *) NULL)
         (void) ThrowMagickException(exception,GetMagickModule(),
           ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);