[Mesa-dev] [PATCH] intel: fix the wrong code to detect null texture.
Yuanhan Liu
yuanhan.liu at linux.intel.com
Thu Sep 8 19:56:36 PDT 2011
There is already comments show how to detect a null texture. Fix the
code to match the comments.
This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.
Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
---
src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index f36240d..717e0ae 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -137,7 +137,7 @@ intel_miptree_create(struct intel_context *intel,
/*
* pitch == 0 || height == 0 indicates the null texture
*/
- if (!mt || !mt->total_height) {
+ if (!mt->total_width || !mt->total_height) {
free(mt);
return NULL;
}
--
1.7.4.4
More information about the mesa-dev
mailing list