mesa/objectlabel: don't return info on genned but never bound textures.
authorDave Airlie <airlied@redhat.com>
Mon, 9 May 2016 06:13:45 +0000 (16:13 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 9 May 2016 20:06:09 +0000 (06:06 +1000)
This fixes some cases in the CTS KHR debug tests where it uses
glIsTexture to find an invalid ID and then call GetObjectLabel.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/objectlabel.c

index 974abbcc6f507c47c3c62f856b702e3ae544d5e4..1e3022ee547a482c8a2bb551f50d50b74c5d6da5 100644 (file)
@@ -196,7 +196,7 @@ get_label_pointer(struct gl_context *ctx, GLenum identifier, GLuint name,
    case GL_TEXTURE:
       {
          struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, name);
-         if (texObj)
+         if (texObj && texObj->Target)
             labelPtr = &texObj->Label;
       }
       break;