From: Cristy Date: Sun, 15 Apr 2018 20:58:11 +0000 (-0400) Subject: https://oss-fuzz.com/v2/testcase-detail/5249469248438272 X-Git-Tag: 7.0.7-29~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3d40ea84eb2a64d8e9116203f681915d034aecf;p=imagemagick https://oss-fuzz.com/v2/testcase-detail/5249469248438272 --- diff --git a/MagickCore/color.c b/MagickCore/color.c index ab38dd00f..7ec9253e7 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -2402,7 +2402,9 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, color->depth=8; } SetGeometryInfo(&geometry_info); - flags=ParseGeometry(name+i+1,&geometry_info); + flags=0; + if (i < strlen(name)) + flags=ParseGeometry(name+i+1,&geometry_info); if (flags == 0) { char @@ -2529,7 +2531,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, if (p == (const ColorInfo *) NULL) return(MagickFalse); color->colorspace=sRGBColorspace; - if ((LocaleNCompare(name,"gray",4) == 0) || + if ((LocaleNCompare(name,"gray",4) == 0) || (LocaleNCompare(name,"grey",4) == 0)) color->colorspace=GRAYColorspace; color->depth=8;