summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-11-17 17:49:43 +0000
committerManolo Gouy <Manolo>2016-11-17 17:49:43 +0000
commit22e6b7b4a34ed8de58276d3582bc89077c5927b7 (patch)
tree225a93b4ae19036522faec205dbc8b81ad1e8754
parent4b6dfbfb4c674b74848b5583e079aa083da66cb5 (diff)
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
-rw-r--r--src/Fl_Screen_Driver.cxx3
1 files changed, 3 insertions, 0 deletions
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);