st/va: fix incorrect use of resource_destroy

Fixes: 4373dd3215 ("st/va: Support YUV formats in vaCreateSurfaces")
Cc: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Marek Olšák 2018-11-02 20:56:42 -04:00
parent 5aeee1ab15
commit 04298a2f24
1 changed files with 2 additions and 4 deletions

View File

@ -598,10 +598,8 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface,
return VA_STATUS_SUCCESS;
fail:
for (i = 0; i < VL_NUM_COMPONENTS; i++) {
if (resources[i])
pscreen->resource_destroy(pscreen, resources[i]);
}
for (i = 0; i < VL_NUM_COMPONENTS; i++)
pipe_resource_reference(&resources[i], NULL);
return result;
}