From 8b5386df799f2134b5c3c28d654f5ad84296bd77 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 3 Nov 2021 17:26:19 +0100 Subject: [PATCH] Fixed an issue where corrupt SVG graphics could crash the application. --- es-core/src/resources/TextureData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index 28d1dc154..e51908489 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -63,7 +63,7 @@ bool TextureData::initSVGFromMemory(const std::string& fileData) NSVGimage* svgImage{nsvgParse(const_cast(fileData.c_str()), "px", DPI)}; - if (!svgImage) { + if (!svgImage || svgImage->width == 0 || svgImage->height == 0) { LOG(LogError) << "Couldn't parse SVG image"; return false; }