Commit b6714fa0 authored by Ilya Basin's avatar Ilya Basin Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8baaa924
...@@ -269,7 +269,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) ...@@ -269,7 +269,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
} }
if (!got_packet) if (!got_packet)
return; goto freeframe;
pkt.stream_index = st->index; pkt.stream_index = st->index;
...@@ -280,6 +280,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) ...@@ -280,6 +280,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
av_err2str(ret)); av_err2str(ret));
exit(1); exit(1);
} }
freeframe:
av_frame_free(&frame); av_frame_free(&frame);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment