mesa: if maxLevels==0, target is invalid

This commit is contained in:
Brian Paul
2009-08-13 10:16:59 -06:00
parent fe988d786c
commit 423a53f635
+4 -1
View File
@@ -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)" );