From 84b3ad5a7ee7aad930ce0eb0bd5056414860d3a5 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 21 Nov 2017 21:09:08 +0100 Subject: [PATCH] Use filename from blob_info in case a temporary file is used. --- MagickCore/blob.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/MagickCore/blob.c b/MagickCore/blob.c index a124baa62..71a227f10 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -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); -- 2.40.0