From: Laura Ekstrand Date: Wed, 4 Mar 2015 18:49:55 +0000 (-0800) Subject: main: _mesa_cube_level_complete checks NumLayers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ee000a0b6737d6c140d4f07b6044908b8ebfdc7;p=mesa.git main: _mesa_cube_level_complete checks NumLayers. _mesa_cube_level_complete now verifies that a cube map texture object actually has six texture images before proceeding. Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index e018ab9103c..a99b108d35f 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -879,6 +879,10 @@ _mesa_cube_level_complete(const struct gl_texture_object *texObj, if (texObj->Target != GL_TEXTURE_CUBE_MAP) return GL_FALSE; + /* Make sure we have enough image planes for a cube map. */ + if (texObj->NumLayers < 6) + return GL_FALSE; + if ((level < 0) || (level >= MAX_TEXTURE_LEVELS)) return GL_FALSE;