From: Cristy Date: Sun, 22 Apr 2018 22:34:25 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-29~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=198399d97695f18161d6460f8189566e3d1a9b96;p=imagemagick ... --- diff --git a/coders/mvg.c b/coders/mvg.c index bbc996876..2a49f0a8c 100644 --- a/coders/mvg.c +++ b/coders/mvg.c @@ -126,8 +126,6 @@ static MagickBooleanType IsMVG(const unsigned char *magick,const size_t length) */ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { -#define BoundingBox "viewbox" - DrawInfo *draw_info; @@ -171,11 +169,14 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) memset(&bounds,0,sizeof(bounds)); while (ReadBlobString(image,primitive) != (char *) NULL) { + int + count; + for (p=primitive; (*p == ' ') || (*p == '\t'); p++) ; - if (LocaleNCompare(BoundingBox,p,strlen(BoundingBox)) != 0) - continue; - (void) sscanf(p,"viewbox %lf %lf %lf %lf",&bounds.x1,&bounds.y1, + count=sscanf(p,"viewbox %lf %lf %lf %lf",&bounds.x1,&bounds.y1, &bounds.x2,&bounds.y2); + if (count != 4) + continue; image->columns=(size_t) floor((bounds.x2-bounds.x1)+0.5); image->rows=(size_t) floor((bounds.y2-bounds.y1)+0.5); break;