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>
/*
* 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;
}