radeon/uvd: fix contex buffer destruction in the error path
authorChristian König <christian.koenig@amd.com>
Thu, 7 Jul 2016 09:22:32 +0000 (11:22 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 8 Jul 2016 19:03:32 +0000 (21:03 +0200)
Destroying a not allocated buffer is harmless.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
src/gallium/drivers/radeon/radeon_uvd.c

index 52658fa23939620b6309f3434fbe5195ddf0d987..275d8266c22d7f36158448fc7a18a273b9c528a8 100644 (file)
@@ -937,10 +937,7 @@ static void ruvd_destroy(struct pipe_video_codec *decoder)
        }
 
        rvid_destroy_buffer(&dec->dpb);
-       if ((u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_FORMAT_HEVC) ||
-           (dec->stream_type == RUVD_CODEC_H264_PERF &&
-           ((struct r600_common_screen*)dec->screen)->family >= CHIP_POLARIS10))
-               rvid_destroy_buffer(&dec->ctx);
+       rvid_destroy_buffer(&dec->ctx);
 
        FREE(dec);
 }
@@ -1288,8 +1285,7 @@ error:
        }
 
        rvid_destroy_buffer(&dec->dpb);
-       if (dec->stream_type == RUVD_CODEC_H264_PERF && info.family >= CHIP_POLARIS10)
-               rvid_destroy_buffer(&dec->ctx);
+       rvid_destroy_buffer(&dec->ctx);
 
        FREE(dec);