From: cristy Date: Sat, 2 May 2015 23:19:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1071 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20160f3f01b6cb3b3387d7ffd7236c0febdccded;p=imagemagick --- diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 9ae3bec3e..b7be47e09 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -7414,12 +7414,19 @@ WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand, ImageInfo *read_info; + unsigned char + *data; + assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (IfMagickTrue(wand->debug)) + if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + data=(unsigned char *) AcquireQuantumMemory(length,sizeof(*data)); + if (data == (unsigned char *) NULL) + ThrowWandException(WandError,"MemoryAllocationFailed",wand->name); + (void) memcpy(data,blob,length*sizeof(*data)); read_info=CloneImageInfo(wand->image_info); - SetImageInfoBlob(read_info,blob,length); + SetImageInfoBlob(read_info,data,length); images=PingImage(read_info,wand->exception); read_info=DestroyImageInfo(read_info); if (images == (Image *) NULL)