diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 53b1e368fd1..1a9db071294 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3564,6 +3564,7 @@ egl_image_target_texture(struct gl_context *ctx, !(target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s(texture is imported from dmabuf)", caller); + pipe_resource_reference(&stimg.texture, NULL); _mesa_unlock_texture(ctx, texObj); return; }