mesa: fix using texture id 0 with VDPAURegisterSurfaceNV()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 21 Jun 2017 08:01:55 +0000 (10:01 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 22 Jun 2017 08:41:22 +0000 (10:41 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/vdpau.c

index 44be3a3..051071b 100644 (file)
@@ -145,11 +145,11 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
    surf->output = isOutput;
    for (i = 0; i < numTextureNames; ++i) {
       struct gl_texture_object *tex;
-      tex  = _mesa_lookup_texture(ctx, textureNames[i]);
+
+      tex = _mesa_lookup_texture_err(ctx, textureNames[i],
+                                     "VDPAURegisterSurfaceNV");
       if (tex == NULL) {
          free(surf);
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "VDPAURegisterSurfaceNV(texture ID not found)");
          return (GLintptr)NULL;
       }