aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-08-13 10:16:59 -0600
committerBrian Paul <brianp@vmware.com>2009-08-13 12:50:56 -0600
commit423a53f635f82233e9a570bfc132edc51f7548bb (patch)
treef1f8804c6f7ca70818d84130c77bd1d59b8f1498
parentfe988d786c4076bfbf410b84085d8c1115baa489 (diff)
mesa: if maxLevels==0, target is invalid
-rw-r--r--src/mesa/main/texgetimage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 2d3b82dd387..14d6fc76590 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -373,7 +373,10 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage;
const GLuint maxLevels = _mesa_max_texture_levels(ctx, target);
- ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */
+ if (maxLevels == 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target=0x%x)", target);
+ return GL_TRUE;
+ }
if (level < 0 || level >= maxLevels) {
_mesa_error( ctx, GL_INVALID_VALUE, "glGetTexImage(level)" );