[Mesa-dev] [PATCH 03/12] i965: Fix error path for MCS allocation.

Eric Anholt eric at anholt.net
Thu Apr 11 11:06:30 PDT 2013


Asserts don't stop execution in release builds, so we would continue on to
use an uninitialized format value.  Just take the failure path, which
appears to continue up the call stack for a while.
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index bd31368..772c393 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -950,7 +950,7 @@ intel_miptree_alloc_mcs(struct intel_context *intel,
       break;
    default:
       assert(!"Unrecognized sample count in intel_miptree_alloc_mcs");
-      break;
+      return false;
    };
 
    /* From the Ivy Bridge PRM, Vol4 Part1 p76, "MCS Base Address":
-- 
1.7.10.4



More information about the mesa-dev mailing list