[Mesa-dev] [PATCH] st/va: restore old buffer format on error

Eric Engestrom eric at engestrom.ch
Tue May 31 01:24:24 UTC 2016


CoverityID: 1337953

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
---

Note that I do not know this code at all; I'm blindly following Coverity's advice on this one :]

---
 src/gallium/state_trackers/va/image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index 92d014c..8cfe17a 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -490,6 +490,7 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
 
    views = surf->buffer->get_sampler_view_planes(surf->buffer);
    if (!views) {
+      surf->templat.buffer_format = old_surf_format;
       pipe_mutex_unlock(drv->mutex);
       return VA_STATUS_ERROR_OPERATION_FAILED;
    }
-- 
2.8.3



More information about the mesa-dev mailing list