summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2014-01-16 13:53:27 -0800
committerBrian Paul <brianp@vmware.com>2014-01-17 08:52:37 -0800
commit3618ac4f202138079024ea6ed2cf7e2ef5463066 (patch)
tree0102c1e7ff97e91bf4df368753a68c5932c90c2c
parentd6fa71fbb0d365cefdabfea9de62cfece71f7486 (diff)
downloadexternal_mesa3d-3618ac4f202138079024ea6ed2cf7e2ef5463066.zip
external_mesa3d-3618ac4f202138079024ea6ed2cf7e2ef5463066.tar.gz
external_mesa3d-3618ac4f202138079024ea6ed2cf7e2ef5463066.tar.bz2
svga: fix crash when clearing null color buffer
Fixes regression since 9baa45f78b8ca7d66280e36009b6a685055d7cd6 but some of the piglit fbo-drawbuffers-none tests still don't pass. v2: use the right pointer type for 'h' Reviewed-by: José Fonseca <jfonseca@vmware.com>
-rw-r--r--src/gallium/drivers/svga/svga_pipe_clear.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index 47f6258..5deebb2 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -111,9 +111,13 @@ svga_clear(struct pipe_context *pipe, unsigned buffers,
struct svga_context *svga = svga_context( pipe );
enum pipe_error ret;
- if (buffers & PIPE_CLEAR_COLOR)
- SVGA_DBG(DEBUG_DMA, "clear sid %p\n",
- svga_surface(svga->curr.framebuffer.cbufs[0])->handle);
+ if (buffers & PIPE_CLEAR_COLOR) {
+ struct svga_winsys_surface *h = NULL;
+ if (svga->curr.framebuffer.cbufs[0]) {
+ h = svga_surface(svga->curr.framebuffer.cbufs[0])->handle;
+ }
+ SVGA_DBG(DEBUG_DMA, "clear sid %p\n", h);
+ }
/* flush any queued prims (don't want them to appear after the clear!) */
svga_hwtnl_flush_retry(svga);