diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-07-25 16:47:57 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-07-25 16:47:57 +0200 |
commit | a986514d0e1ebe78677af6200172fc391e3f063c (patch) | |
tree | b7089c85b87541a8f8ed2235d249f628741a9dc8 /plugingui | |
parent | 773a6ce4d153c6ecc8fb5cf9b41bcf9f25144d7c (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.cc | 5 |
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(); |