]> granicus.if.org Git - imagemagick/commitdiff
Use filename from blob_info in case a temporary file is used.
authorDirk Lemstra <dirk@git.imagemagick.org>
Tue, 21 Nov 2017 20:09:08 +0000 (21:09 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Tue, 21 Nov 2017 20:09:08 +0000 (21:09 +0100)
MagickCore/blob.c

index a124baa62c39e664ba9bb2e3948bce5bbaac68eb..71a227f10c3b45e96b92950399982523c224ee75 100644 (file)
@@ -454,11 +454,15 @@ MagickExport Image *BlobToImage(const ImageInfo *image_info,const void *blob,
     }
   if (GetMagickBlobSupport(magick_info) != MagickFalse)
     {
+      char
+        filename[MagickPathExtent];
+
       /*
         Native blob support for this image format.
       */
+      (void) CopyMagickString(filename,blob_info->filename,MagickPathExtent);
       (void) FormatLocaleString(blob_info->filename,MagickPathExtent,"%s:%s",
-        blob_info->magick,image_info->filename);
+        blob_info->magick,filename);
       image=ReadImage(blob_info,exception);
       if (image != (Image *) NULL)
         (void) DetachBlob(image->blob);
@@ -764,12 +768,16 @@ MagickExport Image *CustomStreamToImage(const ImageInfo *image_info,
   if ((GetMagickBlobSupport(magick_info) != MagickFalse) ||
       (blob_info->custom_stream == (CustomStreamInfo *) NULL))
     {
+      char
+        filename[MagickPathExtent];
+
       /*
         Native blob support for this image format or SetImageInfo changed the
         blob to a file.
       */
+      (void) CopyMagickString(filename,blob_info->filename,MagickPathExtent);
       (void) FormatLocaleString(blob_info->filename,MagickPathExtent,"%s:%s",
-        blob_info->magick,image_info->filename);
+        blob_info->magick,filename);
       image=ReadImage(blob_info,exception);
       if (image != (Image *) NULL)
         (void) CloseBlob(image);