From: José Fonseca Date: Fri, 27 Mar 2009 21:43:24 +0000 (+0000) Subject: wgl: Don't flush surface if it is NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa011836c2778d242c75547c3f64435a055a86ff;p=mesa.git wgl: Don't flush surface if it is NULL. Just a quick fix to prevent segfaults with glean. --- 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; }