diff options
author | Fredrik Höglund <fredrik@kde.org> | 2015-05-09 15:31:45 +0200 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-05-20 22:09:07 +0100 |
commit | 7f7e74b5360b9ee876743ff7a2046fab90aacf29 (patch) | |
tree | 1604a1f4a5c5f5618dcca24c46b6c0dfa0d10237 | |
parent | a2624f2d2eb41c859a8754d81c262aab6b21dd22 (diff) | |
download | mesa-7f7e74b5360b9ee876743ff7a2046fab90aacf29.tar.gz |
mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8ba7ad8abc7d71131e17970203c991ccb1befbe6)
-rw-r--r-- | src/mesa/main/fbobject.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index bbf8aed3aaf..7e2d0cae7e6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2452,6 +2452,18 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, return; } + /* Page 306 (page 328 of the PDF) of the OpenGL 4.5 (Core Profile) + * spec says: + * + * "An INVALID_VALUE error is generated if texture is non-zero + * and layer is negative." + */ + if (zoffset < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%s(layer %u < 0)", caller, zoffset); + return; + } + if (texObj->Target == GL_TEXTURE_3D) { const GLuint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); if (zoffset >= maxSize) { |