mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
ffmpeg_vaapi: Always set hwaccel_ctx, so it gets properly cleaned up on error
Fixes CID 1398954.
This commit is contained in:
parent
3420b34a8a
commit
55a7e7e398
@ -157,6 +157,7 @@ int vaapi_decode_init(AVCodecContext *avctx)
|
|||||||
if (!ctx)
|
if (!ctx)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
ctx->class = &vaapi_class;
|
ctx->class = &vaapi_class;
|
||||||
|
ist->hwaccel_ctx = ctx;
|
||||||
|
|
||||||
ctx->device_ref = av_buffer_ref(hw_device_ctx);
|
ctx->device_ref = av_buffer_ref(hw_device_ctx);
|
||||||
ctx->device = (AVHWDeviceContext*)ctx->device_ref->data;
|
ctx->device = (AVHWDeviceContext*)ctx->device_ref->data;
|
||||||
@ -202,7 +203,6 @@ int vaapi_decode_init(AVCodecContext *avctx)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ist->hwaccel_ctx = ctx;
|
|
||||||
ist->hwaccel_uninit = &vaapi_decode_uninit;
|
ist->hwaccel_uninit = &vaapi_decode_uninit;
|
||||||
ist->hwaccel_get_buffer = &vaapi_get_buffer;
|
ist->hwaccel_get_buffer = &vaapi_get_buffer;
|
||||||
ist->hwaccel_retrieve_data = &vaapi_retrieve_data;
|
ist->hwaccel_retrieve_data = &vaapi_retrieve_data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user