Skip to content

Commit

Permalink
ffmpeg_vaapi: Always set hwaccel_ctx, so it gets properly cleaned up …
Browse files Browse the repository at this point in the history
…on error

Fixes CID 1398954.
  • Loading branch information
fhvwy committed Feb 5, 2017
1 parent 3420b34 commit 55a7e7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ffmpeg_vaapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 55a7e7e

Please sign in to comment.