Commit 634f3a971 for imagemagick.org
commit 634f3a971647a6f94b77afe667f9c76ebb3ff551
Author: Cristy <urban-warrior@imagemagick.org>
Date: Mon Jun 22 23:03:01 2026 -0400
correct allow coder logic
diff --git a/MagickCore/constitute-private.h b/MagickCore/constitute-private.h
index e08573a21..a283f7429 100644
--- a/MagickCore/constitute-private.h
+++ b/MagickCore/constitute-private.h
@@ -58,20 +58,19 @@ static inline Image *StrictReadImage(const ImageInfo *image_info,
LocaleUpper(magic);
if (IsAllowedCoder(magic) == MagickFalse)
{
- (void) ThrowMagickException(exception,GetMagickModule(),
- OptionError, "ExplicitCoderNotAllowed","`%s'",
- image_info->filename);
- return((Image *) NULL);
- }
+ (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+ "ExplicitCoderNotAllowed","`%s'",image_info->filename);
+ return((Image *) NULL);
+ }
+ else
+ return(ReadImage(image_info,exception));
+ }
+ if (IsPathAccessible(image_info->filename) == MagickFalse)
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
+ "UnableToOpenFile","`%s'",image_info->filename);
+ return((Image *) NULL);
}
- else
- if (IsPathAccessible(image_info->filename) == MagickFalse)
- {
- (void) ThrowMagickException(exception,GetMagickModule(),
- FileOpenError, "UnableToOpenFile","`%s'",
- image_info->filename);
- return((Image *) NULL);
- }
return(ReadImage(image_info,exception));
}