From 846abc96efa3536cefa3a271713b9f4444f48650 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 15 Dec 2018 12:34:29 -0500 Subject: [PATCH] https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=35177 --- MagickCore/utility.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 0e3c008f1..539154f77 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -1363,10 +1363,8 @@ MagickExport void GetPathComponent(const char *path,PathType type, case SubimagePath: { *component='\0'; - if ((subimage_length != 0) && - (magick_length+subimage_offset) < strlen(path)) - (void) CopyMagickString(component,path+magick_length+subimage_offset, - subimage_length); + if ((subimage_length != 0) && (magick_length < subimage_offset)) + (void) CopyMagickString(component,path+subimage_offset,subimage_length); break; } case SubcanonicalPath: -- 2.40.0