[FFmpeg-cvslog] lavc: do not leak the internal frame if opening the codec fails

Anton Khirnov git at videolan.org
Mon Jan 6 15:49:19 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Dec 16 22:54:43 2013 +0100| [50079a6aa93291e6dc9d9fb8d33da83f79e9311d] | committer: Anton Khirnov

lavc: do not leak the internal frame if opening the codec fails

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

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

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1c56d79..1b29b1b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1102,8 +1102,10 @@ end:
 free_and_end:
     av_dict_free(&tmp);
     av_freep(&avctx->priv_data);
-    if (avctx->internal)
+    if (avctx->internal) {
+        av_frame_free(&avctx->internal->to_free);
         av_freep(&avctx->internal->pool);
+    }
     av_freep(&avctx->internal);
     avctx->codec = NULL;
     goto end;



More information about the ffmpeg-cvslog mailing list