[FFmpeg-devel] [PATCH] ffmpeg: unref decoded video frame.

Nicolas George nicolas.george at normalesup.org
Mon Mar 11 19:34:22 CET 2013

Fix a memory leak with some decoders.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
 ffmpeg.c |    1 +
 1 file changed, 1 insertion(+)

I have no idea why it does not happen with all decoders or with audio, but
since that part of the code will change soon anyway once the next commits
have been merged, taking time to understand it now would be wasted, better
understand it later.

diff --git a/ffmpeg.c b/ffmpeg.c
index 7b6123a..88adfdb 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1762,6 +1762,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
+    av_frame_unref(decoded_frame);
     return ret;

More information about the ffmpeg-devel mailing list