Commit 1907ff0a authored by Lukasz Marek's avatar Lukasz Marek

lavc/utils: free private options on avcodec_open2 fail

It protects leaking string/binary/dict options from priv context.
Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki2@gmail.com>
parent ea0d8938
...@@ -1690,6 +1690,8 @@ end: ...@@ -1690,6 +1690,8 @@ end:
return ret; return ret;
free_and_end: free_and_end:
av_dict_free(&tmp); av_dict_free(&tmp);
if (codec->priv_class && codec->priv_data_size)
av_opt_free(avctx->priv_data);
av_freep(&avctx->priv_data); av_freep(&avctx->priv_data);
if (avctx->internal) { if (avctx->internal) {
av_frame_free(&avctx->internal->to_free); av_frame_free(&avctx->internal->to_free);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment