From: Ben Skeggs Date: Mon, 5 Oct 2009 05:51:47 +0000 (+1000) Subject: st/dri: avoid segfault if we can't get a pixmap's buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d47de5054091a5d1fa9b19687ac80bcdc39a5f8f;p=mesa.git st/dri: avoid segfault if we can't get a pixmap's buffers Signed-off-by: Ben Skeggs --- diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 6aafb384ef5..3f8dc8df75e 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); }