]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 2 May 2015 23:19:58 +0000 (23:19 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 2 May 2015 23:19:58 +0000 (23:19 +0000)
MagickWand/magick-image.c

index 9ae3bec3eb419607433bfc8ff92ce02114630725..b7be47e090440cfd796b383f8cce4b1b67bd288f 100644 (file)
@@ -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)