From aa011836c2778d242c75547c3f64435a055a86ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 27 Mar 2009 21:43:24 +0000 Subject: [PATCH] wgl: Don't flush surface if it is NULL. Just a quick fix to prevent segfaults with glean. --- .../state_trackers/wgl/shared/stw_framebuffer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c index 2f0d8cbc318..4641884f950 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c @@ -225,11 +225,14 @@ stw_swap_buffers( */ st_notify_swapbuffers( fb->stfb ); - st_get_framebuffer_surface( fb->stfb, ST_SURFACE_BACK_LEFT, &surf ); - - stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen, - surf, - hdc ); + if(st_get_framebuffer_surface( fb->stfb, ST_SURFACE_BACK_LEFT, &surf )) { + stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen, + surf, + hdc ); + } + else { + /* FIXME: this shouldn't happen, but does on glean */ + } return TRUE; } -- 2.30.2