From b6714fa077d9d6ba8bc0f46a84c9398d413b8c22 Mon Sep 17 00:00:00 2001 From: Ilya Basin Date: Mon, 16 Dec 2013 13:05:51 +0400 Subject: examples/muxing: fix av_frame_free() not called when got_packet is false Hi list! Since my last patch (fix 2 memleaks in doc/examples/muxing.c) I found more problems to fix. Signed-off-by: Michael Niedermayer --- doc/examples/muxing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/examples/muxing.c') diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 9ad6e28281..5f716c22a4 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -269,7 +269,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) } if (!got_packet) - return; + goto freeframe; pkt.stream_index = st->index; @@ -280,6 +280,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) av_err2str(ret)); exit(1); } +freeframe: av_frame_free(&frame); } -- cgit v1.2.3