intel: fix the wrong code to detect null texture.
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Fri, 23 Sep 2011 05:34:26 +0000 (13:34 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Fri, 23 Sep 2011 05:34:26 +0000 (13:34 +0800)
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@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index b77c5d708f1b34a079b81ef7c2a99368c12dd406..18427b5c8eadfe77e443c527a4a1070f6ba10353 100644 (file)
@@ -136,7 +136,7 @@ intel_miptree_create(struct intel_context *intel,
    /*
     * pitch == 0 || height == 0  indicates the null texture
     */
-   if (!mt || !mt->total_height) {
+   if (!mt || !mt->total_width || !mt->total_height) {
       free(mt);
       return NULL;
    }