From aa9e2e888ef7eaca961e6d7c17ec1ebab0469e54 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 20 Nov 2020 10:33:31 +0100 Subject: Fix for issue #159 - continued Changes here concentrate the fix within static function alpha_blend() and thus are visible only when drawing transparent images under X11 platform without Xrender. --- src/fl_read_image.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fl_read_image.cxx') diff --git a/src/fl_read_image.cxx b/src/fl_read_image.cxx index 90cefe5a7..de6907fe4 100644 --- a/src/fl_read_image.cxx +++ b/src/fl_read_image.cxx @@ -50,7 +50,7 @@ uchar *fl_read_image(uchar *p, int X, int Y, int w, int h, int alpha) { img = Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Window::current(), X, Y, w, h, NULL); } int depth = alpha ? 4 : 3; - if (img->d() != depth) { + if (img && img->d() != depth) { uchar *data = new uchar[img->w() * img->h() * depth]; if (depth == 4) memset(data, alpha, img->w() * img->h() * depth); uchar *d = data; -- cgit v1.2.3