From: Cristy Date: Tue, 24 Apr 2018 00:52:46 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-29~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aff15c8b3c923004bebdffb5abc99b4c2c69c3d0;p=imagemagick ... --- diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 0063fde9e..38cd16141 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -1741,35 +1741,30 @@ static char *GetGroupByURL(const char *primitive,const char *url) if (LocaleCompare("pop",token) == 0) { GetNextToken(q,&q,extent,token); - if (LocaleCompare("graphic-context",token) == 0) - if (n == 0) - { - /* - End of group by ID. - */ - if (start != (const char *) NULL) - length=(size_t) (p-start+1); - break; - } + if ((n == 0) && (start != (const char *) NULL)) + { + /* + End of group by ID. + */ + length=(size_t) (p-start+1); + break; + } n--; } if (LocaleCompare("push",token) == 0) { GetNextToken(q,&q,extent,token); - if (LocaleCompare("graphic-context",token) == 0) + n++; + if (*q == '"') { - n++; - if (*q == '"') + GetNextToken(q,&q,extent,token); + if (LocaleCompare(url,token) == 0) { - GetNextToken(q,&q,extent,token); - if (LocaleCompare(url,token) == 0) - { - /* - Start of group by ID. - */ - n=0; - start=q; - } + /* + Start of group by ID. + */ + n=0; + start=q; } } }