From: cristy Date: Wed, 22 Aug 2012 12:00:43 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5089 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c42554fd7e1d62dbcda6be7eb8b73ba7315cc8f1;p=imagemagick --- diff --git a/MagickCore/blob.c b/MagickCore/blob.c index 7fb96c982..0a38244a6 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -1543,13 +1543,17 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, image->blob->exempt=MagickTrue; *image->filename='\0'; status=WriteImage(blob_info,image,exception); - if ((status != MagickFalse) && (image->blob->length != 0)) + if (status != MagickFalse) { - *length=image->blob->length; - blob=DetachBlob(image->blob); - blob=(unsigned char *) ResizeQuantumMemory(blob,*length, - sizeof(*blob)); + blob_info->blob=(unsigned char *) + RelinquishMagickMemory(blob_info->blob); + blob_info=DestroyImageInfo(blob_info); + return((unsigned char *) NULL); } + *length=image->blob->length; + blob=DetachBlob(image->blob); + blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1, + sizeof(*blob)); } } else