From: Cristy Date: Sat, 15 Dec 2018 17:34:29 +0000 (-0500) Subject: https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=35177 X-Git-Tag: 7.0.8-17~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=846abc96efa3536cefa3a271713b9f4444f48650;p=imagemagick https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=35177 --- 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: