]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1245
authorCristy <urban-warrior@imagemagick.org>
Sat, 11 Aug 2018 23:45:22 +0000 (19:45 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 11 Aug 2018 23:45:22 +0000 (19:45 -0400)
MagickCore/blob.c
MagickCore/image.c
MagickCore/token.c

index 21f1998a0dda3c5a4fe462208ee43915ad55fbe2..40146993b7d367eed61c21bfbf11993b9134466b 100644 (file)
@@ -1390,15 +1390,17 @@ MagickExport void *FileToBlob(const char *filename,const size_t extent,
         "NotAuthorized","`%s'",filename);
       return(NULL);
     }
-  status=GetPathAttributes(filename,&attributes);
-  if ((status == MagickFalse) || (S_ISDIR(attributes.st_mode) != 0))
-    {
-      ThrowFileException(exception,BlobError,"UnableToReadBlob",filename);
-      return(NULL);
-    }
   file=fileno(stdin);
   if (LocaleCompare(filename,"-") != 0)
-    file=open_utf8(filename,O_RDONLY | O_BINARY,0);
+    {
+      status=GetPathAttributes(filename,&attributes);
+      if ((status == MagickFalse) || (S_ISDIR(attributes.st_mode) != 0))
+        {
+          ThrowFileException(exception,BlobError,"UnableToReadBlob",filename);
+          return(NULL);
+        }
+      file=open_utf8(filename,O_RDONLY | O_BINARY,0);
+    }
   if (file == -1)
     {
       ThrowFileException(exception,BlobError,"UnableToOpenFile",filename);
index a74ba1118cfa7f1994f88442b10776cd22efcf15..9fdb8329240ad6b7dd0ae1af6c9d379690fadbcc 100644 (file)
@@ -2936,7 +2936,7 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info,
     }
   if (image_info->affirm != MagickFalse)
     return(MagickTrue);
-  if (frames == 0)
+  if ((frames == 0) && (*image_info->filename != '\0'))
     {
       unsigned char
         *magick;
index d5435273dea85ef34a72ffa837255c0bb9daa4c8..abddc26b0f02ecd5e5d675ec77dc47fd529e72fd 100644 (file)
@@ -383,7 +383,7 @@ MagickExport MagickBooleanType GlobExpression(const char *expression,
       image_info=AcquireImageInfo();
       (void) CopyMagickString(image_info->filename,pattern,MagickPathExtent);
       exception=AcquireExceptionInfo();
-      (void) SetImageInfo(image_info,1,exception);
+      (void) SetImageInfo(image_info,0,exception);
       exception=DestroyExceptionInfo(exception);
       if (LocaleCompare(image_info->filename,pattern) != 0)
         {