From bfc498f3d03bdeaa55e836517fcb1ddf58854fd5 Mon Sep 17 00:00:00 2001 From: Martin Capitanio Date: Wed, 5 Apr 2023 19:15:21 +0200 Subject: [PATCH] SVG: fix tvg::Picture->size() and scale based errors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ©mi Verschelde --- modules/svg/image_loader_svg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp index e239b33374f..ad7feeda497 100644 --- a/modules/svg/image_loader_svg.cpp +++ b/modules/svg/image_loader_svg.cpp @@ -79,8 +79,8 @@ Error ImageLoaderSVG::create_image_from_utf8_buffer(Ref p_image, const Pa float fw, fh; picture->size(&fw, &fh); - uint32_t width = round(fw * p_scale); - uint32_t height = round(fh * p_scale); + uint32_t width = MAX(1, round(fw * p_scale)); + uint32_t height = MAX(1, round(fh * p_scale)); const uint32_t max_dimension = 16384; if (width > max_dimension || height > max_dimension) {