diff options
author | Laura Ekstrand <laura@jlekstrand.net> | 2015-03-04 11:14:48 -0800 |
---|---|---|
committer | Laura Ekstrand <laura@jlekstrand.net> | 2015-03-09 13:33:53 -0700 |
commit | 70eab80f802b26ac87fe9c3e1fa819affe903afd (patch) | |
tree | 6fbe17d720228e08579f4c10ef535b3ee6411750 /src/mesa/main/texgetimage.c | |
parent | c3e92faeb4875de47f0c83ab807b4ea298bfa079 (diff) |
main: assert(texImage) in ARB_DSA texture cube map functions.
ARB_direct_state_access functions that deal with texture cube
maps need to make sure that texture images are not NULL before operating on
them. In the following cases, the error check functions already throw an
error if texImage == NULL, so an assert can be raised instead.
v2: Review from Anuj Phogat
- Replace redundant "if (!texImage) return;" statements with
assert(texImage)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r-- | src/mesa/main/texgetimage.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 0287ebfcda3..9411db81614 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -1101,6 +1101,8 @@ _mesa_GetTextureImage(GLuint texture, GLint level, GLenum format, /* Copy each face. */ for (i = 0; i < 6; ++i) { texImage = texObj->Image[i][level]; + assert(texImage); + _mesa_get_texture_image(ctx, texObj, texImage, texObj->Target, level, format, type, bufSize, pixels, true); @@ -1306,8 +1308,7 @@ _mesa_GetCompressedTextureImage(GLuint texture, GLint level, /* Copy each face. */ for (i = 0; i < 6; ++i) { texImage = texObj->Image[i][level]; - if (!texImage) - return; + assert(texImage); _mesa_get_compressed_texture_image(ctx, texObj, texImage, texObj->Target, level, |