OSDN Git Service

st/va: fix incorrect use of resource_destroy
authorMarek Olšák <marek.olsak@amd.com>
Sat, 3 Nov 2018 00:56:42 +0000 (20:56 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 8 Nov 2018 16:05:06 +0000 (16:05 +0000)
Fixes: 4373dd32154 ("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>
(cherry picked from commit 04298a2f24455541f28ccffd2f0f73b831833d57)

src/gallium/state_trackers/va/surface.c

index 5376be2..9646427 100644 (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;
 }