Skip to content

Commit

Permalink
Also fix incorrect fclose for bzlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jun 18, 2022
1 parent b6d5881 commit 784f9fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions MagickCore/blob.c
Expand Up @@ -3464,12 +3464,14 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
#if defined(MAGICKCORE_BZLIB_DELEGATE)
if (strncmp((char *) magick,"BZh",3) == 0)
{
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,"r");
if (blob_info->file_info.bzfile != (BZFILE *) NULL)
blob_info->type=BZipStream;
{
if (blob_info->file_info.file != (FILE *) NULL)
(void) fclose(blob_info->file_info.file);
blob_info->file_info.file=(FILE *) NULL;
blob_info->type=BZipStream;
}
}
#endif
if (blob_info->type == FileStream)
Expand Down

0 comments on commit 784f9fe

Please sign in to comment.