From: Cristy Date: Thu, 24 May 2018 12:32:05 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-36~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a57dd6fda1a08fc752954af4298ce3e638ecf479;p=imagemagick ... --- diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 015e655bc..b6c073b14 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -2235,7 +2235,7 @@ static MagickBooleanType CheckPrimitiveExtent(MVGInfo *mvg_info, static char *GetNodeByURL(const char *primitive,const char *url) { char - *token; + *node; const char *q, @@ -2256,8 +2256,8 @@ static char *GetNodeByURL(const char *primitive,const char *url) */ if (primitive == (const char *) NULL) return((char *) NULL); - token=AcquireString(primitive); - extent=strlen(token)+MagickPathExtent; + node=AcquireString(primitive); + extent=strlen(node)+MagickPathExtent; length=0; n=0; start=(const char *) NULL; @@ -2265,10 +2265,10 @@ static char *GetNodeByURL(const char *primitive,const char *url) for (q=primitive; (*q != '\0') && (length == 0); ) { p=q; - GetNextToken(q,&q,extent,token); - if (*token == '\0') + GetNextToken(q,&q,extent,node); + if (*node == '\0') break; - if (*token == '#') + if (*node == '#') { /* Comment. @@ -2277,9 +2277,9 @@ static char *GetNodeByURL(const char *primitive,const char *url) q++; continue; } - if (LocaleCompare("pop",token) == 0) + if (LocaleCompare("pop",node) == 0) { - GetNextToken(q,&q,extent,token); + GetNextToken(q,&q,extent,node); if ((n == 0) && (start != (const char *) NULL)) { /* @@ -2290,14 +2290,14 @@ static char *GetNodeByURL(const char *primitive,const char *url) } n--; } - if (LocaleCompare("push",token) == 0) + if (LocaleCompare("push",node) == 0) { - GetNextToken(q,&q,extent,token); + GetNextToken(q,&q,extent,node); n++; if (*q == '"') { - GetNextToken(q,&q,extent,token); - if (LocaleCompare(url,token) == 0) + GetNextToken(q,&q,extent,node); + if (LocaleCompare(url,node) == 0) { /* Start of node by ID. @@ -2309,9 +2309,9 @@ static char *GetNodeByURL(const char *primitive,const char *url) } } if (start == (const char *) NULL) - return(DestroyString(token)); - (void) CopyMagickString(token,start,length); - return(token); + return(DestroyString(node)); + (void) CopyMagickString(node,start,length); + return(node); } static inline MagickBooleanType IsPoint(const char *point) @@ -2597,10 +2597,25 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, node=GetNodeByURL(primitive,token); if (node != (char *) NULL) { + char + *elements; + + ssize_t + offset; + /* - Insert class elements in stream. + Inject class elements in stream. */ + offset=p-primitive; + elements=AcquireString(primitive); + elements[offset]='\0'; + (void) ConcatenateString(&elements,node); node=DestroyString(node); + (void) ConcatenateString(&elements,"\n"); + (void) ConcatenateString(&elements,q); + primitive=DestroyString(primitive); + primitive=elements; + q=primitive+offset; } break; } diff --git a/coders/jnx.c b/coders/jnx.c index 6ebbad841..6829eda49 100644 --- a/coders/jnx.c +++ b/coders/jnx.c @@ -309,6 +309,7 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception) offset=SeekBlob(image,restore_offset,SEEK_SET); if (tile_image == (Image *) NULL) continue; + tile_image->depth=8; (void) CopyMagickString(tile_image->magick,image->magick, MagickPathExtent); (void) FormatImageProperty(tile_image,"jnx:northeast","%.20g,%.20g",