From b2d1bd0857c5e594d3e06d849ecd813f2f0467ad Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 14 Mar 2017 14:19:11 -0700 Subject: [PATCH] fix another case of #740 --- src/mapnik_image.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp index 0c173b18aa..03c9b53069 100644 --- a/src/mapnik_image.cpp +++ b/src/mapnik_image.cpp @@ -3098,9 +3098,9 @@ void Image::EIO_FromSVGBytes(uv_work_t* req) agg::scanline_u8 sl; double opacity = 1; - int svg_width = svg.width() * closure->scale; - int svg_height = svg.height() * closure->scale; - + double svg_width = svg.width() * closure->scale; + double svg_height = svg.height() * closure->scale; + if (svg_width <= 0 || svg_height <= 0) { closure->error = true; @@ -3108,7 +3108,7 @@ void Image::EIO_FromSVGBytes(uv_work_t* req) return; } - if (svg_width > static_cast(closure->max_size) || svg_height > static_cast(closure->max_size)) + if (svg_width > static_cast(closure->max_size) || svg_height > static_cast(closure->max_size)) { closure->error = true; std::stringstream s; @@ -3117,7 +3117,7 @@ void Image::EIO_FromSVGBytes(uv_work_t* req) return; } - mapnik::image_rgba8 im(svg_width, svg_height, true, true); + mapnik::image_rgba8 im(static_cast(svg_width), static_cast(svg_height), true, true); agg::rendering_buffer buf(im.bytes(), im.width(), im.height(), im.row_size()); pixfmt pixf(buf); renderer_base renb(pixf);