r300: Fix a crash related to depth textures (triggered by Glest w/ shadowmaps)
authorNicolai Haehnle <nhaehnle@gmail.com>
Sun, 27 Jul 2008 19:40:17 +0000 (21:40 +0200)
committerNicolai Haehnle <nhaehnle@gmail.com>
Sun, 27 Jul 2008 19:40:17 +0000 (21:40 +0200)
src/mesa/drivers/dri/r300/r300_tex.c

index c8f02c4ef5bd2164c68f84ff94f2f4b0c888e026..f7f49729bc890ea07aaa38aa8fe823b400099fd6 100644 (file)
@@ -944,6 +944,8 @@ static void r300TexParameter(GLcontext * ctx, GLenum target,
                break;
 
        case GL_DEPTH_TEXTURE_MODE:
+               if (!texObj->Image[0][texObj->BaseLevel])
+                       return;
                if (texObj->Image[0][texObj->BaseLevel]->TexFormat->BaseFormat
                    == GL_DEPTH_COMPONENT) {
                        r300SetDepthTexMode(texObj);