mesa: fix crash in driver_RenderTexture_is_safe
authorMarek Olšák <marek.olsak@amd.com>
Mon, 30 May 2016 14:29:18 +0000 (16:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 31 May 2016 14:43:34 +0000 (16:43 +0200)
This just fixed the crash with the apitrace in bug report.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95246

Cc: 11.1 11.2 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/fbobject.c

index fa5baa3517b19ea1aff8a5f2b3e965e26c5b75a0..bf47c1cf3653d235cf9d80f9c2d2eb06f28cc06d 100644 (file)
@@ -389,7 +389,8 @@ driver_RenderTexture_is_safe(const struct gl_renderbuffer_attachment *att)
    const struct gl_texture_image *const texImage =
       att->Texture->Image[att->CubeMapFace][att->TextureLevel];
 
-   if (texImage->Width == 0 || texImage->Height == 0 || texImage->Depth == 0)
+   if (!texImage ||
+       texImage->Width == 0 || texImage->Height == 0 || texImage->Depth == 0)
       return false;
 
    if ((texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY