[FFmpeg-cvslog] avcodec: Free the default avoptions on init failure

Luca Barbato git at videolan.org
Thu Apr 23 21:57:35 CEST 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Apr 21 18:17:38 2015 +0200| [a78f5548d94f23ce23cece41edf0fe9d18926de6] | committer: Luca Barbato

avcodec: Free the default avoptions on init failure

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a78f5548d94f23ce23cece41edf0fe9d18926de6
---

 libavcodec/utils.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 7740147..c9ae19b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1292,6 +1292,10 @@ free_and_end:
         (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))
         avctx->codec->close(avctx);
 
+    if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
+        av_opt_free(avctx->priv_data);
+    av_opt_free(avctx);
+
     av_dict_free(&tmp);
     av_freep(&avctx->priv_data);
     if (avctx->internal) {



More information about the ffmpeg-cvslog mailing list