[Mesa-dev] [RFC 1/3] i965: prepare_depthbuffer: fix segfault, rhbz#735794
Alon Levy
alevy at redhat.com
Mon Sep 5 12:37:48 PDT 2011
Also fixes a segfault immediatelly after in the same case, i.e.
srb->region is also NULL in the run of virtualbox described in
the bug report in the subject.
Signed-off-by: Alon Levy <alevy at redhat.com>
---
src/mesa/drivers/dri/i965/brw_misc_state.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index f7e6e7c..479cf82 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -204,11 +204,11 @@ static void prepare_depthbuffer(struct brw_context *brw)
struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
- if (drb)
+ if (drb && drb->region)
brw_add_validated_bo(brw, drb->region->buffer);
if (drb && drb->hiz_region)
brw_add_validated_bo(brw, drb->hiz_region->buffer);
- if (srb)
+ if (srb && srb->region)
brw_add_validated_bo(brw, srb->region->buffer);
}
--
1.7.6.1
More information about the mesa-dev
mailing list