Fixed an issue where corrupt SVG graphics could crash the application.

This commit is contained in:
Leon Styhre 2021-11-03 17:26:19 +01:00
parent 1a897a1f0f
commit 8b5386df79

View file

@ -63,7 +63,7 @@ bool TextureData::initSVGFromMemory(const std::string& fileData)
NSVGimage* svgImage{nsvgParse(const_cast<char*>(fileData.c_str()), "px", DPI)};
if (!svgImage) {
if (!svgImage || svgImage->width == 0 || svgImage->height == 0) {
LOG(LogError) << "Couldn't parse SVG image";
return false;
}