main: Require that the texture exists in framebuffer_texture
authorFredrik Höglund <fredrik@kde.org>
Thu, 7 May 2015 18:28:23 +0000 (20:28 +0200)
committerFredrik Höglund <fredrik@kde.org>
Thu, 14 May 2015 13:48:12 +0000 (15:48 +0200)
Generate GL_INVALID_OPERATION if the texture hasn't been created.

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>
src/mesa/main/fbobject.c

index 9486ded05a0c325796f93f1891eacf7cf88a5a67..4524e51e4c03e91dcf7e352e5caef06cc06ca4a6 100644 (file)
@@ -2603,7 +2603,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
       GLboolean err = GL_TRUE;
 
       texObj = _mesa_lookup_texture(ctx, texture);
-      if (texObj != NULL) {
+      if (texObj != NULL && texObj->Target != 0) {
          if (textarget == 0) {
             if (layered) {
                /* We're being called by glFramebufferTexture() and textarget