From d47de5054091a5d1fa9b19687ac80bcdc39a5f8f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 5 Oct 2009 15:51:47 +1000 Subject: st/dri: avoid segfault if we can't get a pixmap's buffers Signed-off-by: Ben Skeggs --- src/gallium/state_trackers/dri/dri_drawable.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 6aafb384ef..3f8dc8df75 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -249,6 +249,9 @@ void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target, dri_get_buffers(drawable->dPriv); st_get_framebuffer_surface(drawable->stfb, ST_SURFACE_FRONT_LEFT, &ps); + if (!ps) + return; + st_bind_texture_surface(ps, target == GL_TEXTURE_2D ? ST_TEXTURE_2D : ST_TEXTURE_RECT, 0, drawable->color_format); } -- cgit v1.2.3