[FFmpeg-cvslog] fate/api-codec-param: fix codec context leak

Matthieu Bouron git at videolan.org
Tue Dec 8 08:13:58 CET 2015


ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at stupeflix.com> | Mon Dec  7 10:00:35 2015 +0100| [bd0a9f603d0c1d0f3be782865f72ac29ab89bc5b] | committer: Matthieu Bouron

fate/api-codec-param: fix codec context leak

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

 tests/api/api-codec-param-test.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/api/api-codec-param-test.c b/tests/api/api-codec-param-test.c
index 9989825..fa51964 100644
--- a/tests/api/api-codec-param-test.c
+++ b/tests/api/api-codec-param-test.c
@@ -129,6 +129,12 @@ static int find_video_stream_info(AVFormatContext *fmt_ctx, int decode)
 end:
     av_packet_unref(&pkt);
 
+    /* close all codecs opened in try_decode_video_frame */
+    for (i = 0; i < fmt_ctx->nb_streams; i++) {
+        AVStream *st = fmt_ctx->streams[i];
+        avcodec_close(st->codec);
+    }
+
     return ret < 0;
 }
 



More information about the ffmpeg-cvslog mailing list