Skip to content

Commit 55a7e7e

Browse files
committed
ffmpeg_vaapi: Always set hwaccel_ctx, so it gets properly cleaned up on error
Fixes CID 1398954.
1 parent 3420b34 commit 55a7e7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ffmpeg_vaapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ int vaapi_decode_init(AVCodecContext *avctx)
157157
if (!ctx)
158158
return AVERROR(ENOMEM);
159159
ctx->class = &vaapi_class;
160+
ist->hwaccel_ctx = ctx;
160161

161162
ctx->device_ref = av_buffer_ref(hw_device_ctx);
162163
ctx->device = (AVHWDeviceContext*)ctx->device_ref->data;
@@ -202,7 +203,6 @@ int vaapi_decode_init(AVCodecContext *avctx)
202203
goto fail;
203204
}
204205

205-
ist->hwaccel_ctx = ctx;
206206
ist->hwaccel_uninit = &vaapi_decode_uninit;
207207
ist->hwaccel_get_buffer = &vaapi_get_buffer;
208208
ist->hwaccel_retrieve_data = &vaapi_retrieve_data;

0 commit comments

Comments
 (0)