intel: fix the wrong code to detect null texture.

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>
This commit is contained in:
Yuanhan Liu 2011-09-23 13:34:26 +08:00
parent cd6b8421ca
commit 1a662e7c18

View 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;
}