blob: 4efd8fceb7bc518aba1f3bef0e6412c438ef4ff2 [file] [log] [blame]
From e9371012760c1a1edb39c7acfc24165cd1778f9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= <marcheu@chromium.org>
Date: Tue, 24 Jun 2014 15:32:37 -0700
Subject: [PATCH 15/24] CHROMIUM: i965: Return NULL if we don't have a miptree
If we have no miptree (irb->mt == NULL) we still go ahead and look at
the stencil miptree, which causes crashes. Instead, let's return NULL if
we don't have a miptree, which will be correctly handled later.
BUG=chromium:387897
TEST=can't reproduce the bug, but compiles and runs
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: James Ausmus <james.ausmus@intel.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
---
src/mesa/drivers/dri/i965/brw_misc_state.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 27511525bffd..21ce2ed00194 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -218,6 +218,8 @@ get_stencil_miptree(struct intel_renderbuffer *irb)
{
if (!irb)
return NULL;
+ if (!irb->mt)
+ return NULL;
if (irb->mt->stencil_mt)
return irb->mt->stencil_mt;
return irb->mt;
--
2.5.1