mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-28 10:50:39 +02:00
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 <anuj.phogat@gmail.com>
This commit is contained in:
parent
c939231e72
commit
1ee000a0b6
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue