aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-01-22 18:25:53 +0000
committerMark Thompson <sw@jkqxz.net>2017-02-05 15:13:15 +0000
commit55a7e7e3986e661f4b02164739c1ea4eaf83f9cf (patch)
tree8ab9b7bac8a63cbf183e9b155a7b42dff0a434e3
parent3420b34a8a63c89d748abe8e99e7acf4c2408a81 (diff)
downloadffmpeg-55a7e7e3986e661f4b02164739c1ea4eaf83f9cf.tar.gz
ffmpeg_vaapi: Always set hwaccel_ctx, so it gets properly cleaned up on error
Fixes CID 1398954.
-rw-r--r--ffmpeg_vaapi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
index 6530908ef4..d011cacef7 100644
--- a/ffmpeg_vaapi.c
+++ b/ffmpeg_vaapi.c
@@ -157,6 +157,7 @@ int vaapi_decode_init(AVCodecContext *avctx)
if (!ctx)
return AVERROR(ENOMEM);
ctx->class = &vaapi_class;
+ ist->hwaccel_ctx = ctx;
ctx->device_ref = av_buffer_ref(hw_device_ctx);
ctx->device = (AVHWDeviceContext*)ctx->device_ref->data;
@@ -202,7 +203,6 @@ int vaapi_decode_init(AVCodecContext *avctx)
goto fail;
}
- ist->hwaccel_ctx = ctx;
ist->hwaccel_uninit = &vaapi_decode_uninit;
ist->hwaccel_get_buffer = &vaapi_get_buffer;
ist->hwaccel_retrieve_data = &vaapi_retrieve_data;