mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where corrupt SVG graphics could crash the application.
This commit is contained in:
parent
1a897a1f0f
commit
8b5386df79
|
@ -63,7 +63,7 @@ bool TextureData::initSVGFromMemory(const std::string& fileData)
|
||||||
|
|
||||||
NSVGimage* svgImage{nsvgParse(const_cast<char*>(fileData.c_str()), "px", DPI)};
|
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";
|
LOG(LogError) << "Couldn't parse SVG image";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue