]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 27 Apr 2014 19:33:02 +0000 (19:33 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 27 Apr 2014 19:33:02 +0000 (19:33 +0000)
MagickCore/blob.c

index f1c5304e27bde5e7564d3663f6ce35046908a51e..91d04cb51922334c026d11bfd9982ca18a28887f 100644 (file)
@@ -2542,8 +2542,9 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
             if (((int) magick[0] == 0x1F) && ((int) magick[1] == 0x8B) &&
                 ((int) magick[2] == 0x08))
               {
-                (void) fclose(image->blob->file_info.file);
-                image->blob->type=UndefinedStream;
+                if (image->blob->file_info.file != (FILE *) NULL)
+                  (void) fclose(image->blob->file_info.file);
+                image->blob->file_info.file=(FILE *) NULL;
                 image->blob->file_info.gzfile=gzopen(filename,type);
                 if (image->blob->file_info.gzfile != (gzFile) NULL)
                   image->blob->type=ZipStream;
@@ -2552,8 +2553,9 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
 #if defined(MAGICKCORE_BZLIB_DELEGATE)
             if (strncmp((char *) magick,"BZh",3) == 0)
               {
-                (void) fclose(image->blob->file_info.file);
-                image->blob->type=UndefinedStream;
+                if (image->blob->file_info.file != (FILE *) NULL)
+                  (void) fclose(image->blob->file_info.file);
+                image->blob->file_info.file=(FILE *) NULL;
                 image->blob->file_info.bzfile=BZ2_bzopen(filename,type);
                 if (image->blob->file_info.bzfile != (BZFILE *) NULL)
                   image->blob->type=BZipStream;