summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2009-10-05 15:51:47 +1000
committerBen Skeggs <[email protected]>2009-10-05 15:52:33 +1000
commitd47de5054091a5d1fa9b19687ac80bcdc39a5f8f (patch)
treea3e7ea77fa5836282dd76525ac4986fe8f73f68a /src/gallium
parent7bfc3172e88cc7ad8be9ab81de56f7e263c15824 (diff)
st/dri: avoid segfault if we can't get a pixmap's buffers
Signed-off-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c3
1 files changed, 3 insertions, 0 deletions
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);
}