From 22e6b7b4a34ed8de58276d3582bc89077c5927b7 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 17 Nov 2016 17:49:43 +0000 Subject: Fix crash when resizing double-buffered window smaller than transparent image (STR#3353). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12117 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Screen_Driver.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index e9fd4ec73..526f37b1e 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -158,6 +158,9 @@ uchar *Fl_Screen_Driver::read_image(uchar *p, int X, int Y, int w, int h, int al Fl_RGB_Image *img; if (fl_find(fl_window) == 0) { // read from off_screen buffer img = read_win_rectangle(p, X, Y, w, h, alpha); + if (!img) { + return NULL; + } img->alloc_array = 1; } else { img = traverse_to_gl_subwindows(Fl_Window::current(), p, X, Y, w, h, alpha, NULL); -- cgit v1.2.3