Commit 71bf0b0b5 for imagemagick.org
commit 71bf0b0b59fbafea1a5ee3f33a6ae261d30e059f
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sun Jun 21 20:28:09 2026 -0400
https://github.com/ImageMagick/ImageMagick/issues/8813
diff --git a/MagickCore/constitute-private.h b/MagickCore/constitute-private.h
index a831c4163..7591783ab 100644
--- a/MagickCore/constitute-private.h
+++ b/MagickCore/constitute-private.h
@@ -39,22 +39,16 @@ static inline Image *StrictReadImage(const ImageInfo *image_info,
(void) GetPathComponent(image_info->filename,MagickPath,magic);
if (*magic != '\0')
{
- (void) ThrowMagickException(exception, GetMagickModule(), OptionError,
+ (void) ThrowMagickException(exception, GetMagickModule(),OptionError,
"ExplicitCoderNotAllowed","`%s'",image_info->filename);
return((Image *) NULL);
}
- if (stat(image_info->filename,&file_info) != 0)
+ if (IsPathAccessible(image_info->filename) == MagickFalse)
{
(void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
"UnableToOpenFile","`%s'",image_info->filename);
return((Image *) NULL);
}
- if (S_ISREG(file_info.st_mode) == 0)
- {
- (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
- "NotARegularFile", "`%s'",image_info->filename);
- return((Image *) NULL);
- }
return(ReadImage(image_info,exception));
}
diff --git a/MagickCore/utility.c b/MagickCore/utility.c
index 21a33fb8d..e989d9ee3 100644
--- a/MagickCore/utility.c
+++ b/MagickCore/utility.c
@@ -1292,8 +1292,7 @@ MagickExport void GetPathComponent(const char *path,PathType type,
if ((strlen(component) > 2) && (*p == ']'))
{
q=strrchr(component,'[');
- if ((q != (char *) NULL) && ((q == component) || (*(q-1) != ']')) &&
- (IsPathAccessible(path) == MagickFalse))
+ if ((q != (char *) NULL) && (IsPathAccessible(path) == MagickFalse))
{
/*
Look for scene specification (e.g. img0001.pcd[4]).