summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-07-25 16:47:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-07-25 16:47:57 +0200
commita986514d0e1ebe78677af6200172fc391e3f063c (patch)
treeb7089c85b87541a8f8ed2235d249f628741a9dc8 /plugingui
parent773a6ce4d153c6ecc8fb5cf9b41bcf9f25144d7c (diff)
Prevent crash if png_error resource is not available when a png load error occurs.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/image.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugingui/image.cc b/plugingui/image.cc
index 54fd15e..1b858ad 100644
--- a/plugingui/image.cc
+++ b/plugingui/image.cc
@@ -91,6 +91,11 @@ void Image::setError()
{
valid = false;
Resource rc(":resources/png_error");
+ if(!rc.valid())
+ {
+ _width = _height = 0u;
+ return;
+ }
const unsigned char* ptr = (const unsigned char*)rc.data();