From 198399d97695f18161d6460f8189566e3d1a9b96 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 22 Apr 2018 18:34:25 -0400 Subject: [PATCH] ... --- coders/mvg.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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; -- 2.40.0