diff options
author | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-23 00:55:33 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-25 23:09:16 +0100 |
commit | 1907ff0a67edeb98d9153aac79f35961837ba3f6 (patch) | |
tree | d985f230e0ac1043c63236feb336c1633f2cdad1 | |
parent | ea0d8938173e12b289243c88c6a79dc6651e6ed9 (diff) | |
download | ffmpeg-1907ff0a67edeb98d9153aac79f35961837ba3f6.tar.gz |
lavc/utils: free private options on avcodec_open2 fail
It protects leaking string/binary/dict options from priv context.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c06a733786..66fe62cc85 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1690,6 +1690,8 @@ end: return ret; free_and_end: av_dict_free(&tmp); + if (codec->priv_class && codec->priv_data_size) + av_opt_free(avctx->priv_data); av_freep(&avctx->priv_data); if (avctx->internal) { av_frame_free(&avctx->internal->to_free); |