]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Mon, 25 Dec 2017 01:15:38 +0000 (20:15 -0500)
committerCristy <urban-warrior@imagemagick.org>
Mon, 25 Dec 2017 01:15:38 +0000 (20:15 -0500)
MagickCore/blob.c

index 90dbfd00e5ccbe7e86f55463af2e29db9cc6eb63..e820c8b377dbbbfdac45e693050bb50d7ae1f2eb 100644 (file)
@@ -3221,7 +3221,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
                 if (blob_info->file_info.file != (FILE *) NULL)
                   (void) fclose(blob_info->file_info.file);
                 blob_info->file_info.file=(FILE *) NULL;
-                blob_info->file_info.gzfile=gzopen(filename,type);
+                blob_info->file_info.gzfile=gzopen(filename,"rb");
                 if (blob_info->file_info.gzfile != (gzFile) NULL)
                   blob_info->type=ZipStream;
                }
@@ -3232,7 +3232,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
                 if (blob_info->file_info.file != (FILE *) NULL)
                   (void) fclose(blob_info->file_info.file);
                 blob_info->file_info.file=(FILE *) NULL;
-                blob_info->file_info.bzfile=BZ2_bzopen(filename,type);
+                blob_info->file_info.bzfile=BZ2_bzopen(filename,"r");
                 if (blob_info->file_info.bzfile != (BZFILE *) NULL)
                   blob_info->type=BZipStream;
               }
@@ -3290,11 +3290,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
             (LocaleCompare(extension,"wmz") == 0) ||
             (LocaleCompare(extension,"svgz") == 0))
           {
-            if (mode == WriteBinaryBlobMode)
-              type="wb";
-            if (mode == AppendBinaryBlobMode)
-              type="ab";
-            blob_info->file_info.gzfile=gzopen(filename,type);
+            blob_info->file_info.gzfile=gzopen(filename,"wb");
             if (blob_info->file_info.gzfile != (gzFile) NULL)
               blob_info->type=ZipStream;
           }
@@ -3303,7 +3299,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
 #if defined(MAGICKCORE_BZLIB_DELEGATE)
           if (LocaleCompare(extension,"bz2") == 0)
             {
-              blob_info->file_info.bzfile=BZ2_bzopen(filename,type);
+              blob_info->file_info.bzfile=BZ2_bzopen(filename,"w");
               if (blob_info->file_info.bzfile != (BZFILE *) NULL)
                 blob_info->type=BZipStream;
             }