radeon: fix fallback case where t->mt is valid NULL
authorDave Airlie <airlied@redhat.com>
Tue, 10 Feb 2009 13:36:28 +0000 (23:36 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 10 Feb 2009 13:36:28 +0000 (23:36 +1000)
src/mesa/drivers/dri/radeon/common_misc.c

index 82cead1a25a5f8a7c482cf6d60c6ecce17fe7972..4770c987c87f3f11f518837c240cbe2139ab4a2f 100644 (file)
@@ -1469,8 +1469,9 @@ void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
        radeonTexObj* t = radeon_tex_obj(texObj);
        int face, level;
 
-       //      assert(texObj->_Complete);
-       assert(t->mt);
+       /* for r100 3D sw fallbacks don't have mt */
+       if (!t->mt)
+         return;
 
        radeon_bo_map(t->mt->bo, GL_FALSE);
        for(face = 0; face < t->mt->faces; ++face) {
@@ -1484,8 +1485,9 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
        radeonTexObj* t = radeon_tex_obj(texObj);
        int face, level;
 
-       //      assert(texObj->_Complete);
-       assert(t->mt);
+       /* for r100 3D sw fallbacks don't have mt */
+       if (!t->mt)
+         return;
 
        for(face = 0; face < t->mt->faces; ++face) {
                for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level)