aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulien Isorce <[email protected]>2016-06-02 15:03:34 +0100
committerJulien Isorce <[email protected]>2016-06-13 09:14:32 +0100
commita04804746f6d999905cda125a0778160d62c73a2 (patch)
treee6101b80241ddbf311a0871df3f091e27afb4a06 /src
parent6c43e0016e344de3d7e82b098992cdfecbff2ab2 (diff)
st/va: use proper temp pipe_video_buffer template
Instead of changing the format on the existing template which makes error handling not nice and confuses coverity. CoverityID: 1337953 Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/va/image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index 92d014c3d44..1b956e36bc1 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -473,19 +473,19 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
if (format != surf->buffer->buffer_format) {
struct pipe_video_buffer *tmp_buf;
- enum pipe_format old_surf_format = surf->templat.buffer_format;
+ struct pipe_video_buffer templat = surf->templat;
- surf->templat.buffer_format = format;
- tmp_buf = drv->pipe->create_video_buffer(drv->pipe, &surf->templat);
+ templat.buffer_format = format;
+ tmp_buf = drv->pipe->create_video_buffer(drv->pipe, &templat);
if (!tmp_buf) {
- surf->templat.buffer_format = old_surf_format;
pipe_mutex_unlock(drv->mutex);
return VA_STATUS_ERROR_ALLOCATION_FAILED;
}
surf->buffer->destroy(surf->buffer);
surf->buffer = tmp_buf;
+ surf->templat.buffer_format = format;
}
views = surf->buffer->get_sampler_view_planes(surf->buffer);