From a986514d0e1ebe78677af6200172fc391e3f063c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 25 Jul 2020 16:47:57 +0200 Subject: Prevent crash if png_error resource is not available when a png load error occurs. --- plugingui/image.cc | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- cgit v1.2.3