From 0dabf1608be6d0268f58db49b38b53987dac6edb Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 24 Dec 2017 20:15:38 -0500 Subject: [PATCH] ... --- MagickCore/blob.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/MagickCore/blob.c b/MagickCore/blob.c index 90dbfd00e..e820c8b37 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -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; } -- 2.40.0