[FFmpeg-cvslog] aacdec: free frame buffer if no audio was decoded

Hendrik Leppkes git at videolan.org
Sat May 4 13:27:37 CEST 2013


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Sat May  4 11:17:00 2013 +0200| [d18341fb1121332056aecc00096159df16d01107] | committer: Michael Niedermayer

aacdec: free frame buffer if no audio was decoded

If no decoding error was detected, but still no audio was decoded, the
frame needs to be free'ed, or it will leak.

Fixes part of ticket #2095

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/aacdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index f60060a..cd7bbb0 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2611,6 +2611,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
 
     if (samples)
         ac->frame->nb_samples = samples;
+    else
+        av_frame_unref(ac->frame);
     *got_frame_ptr = !!samples;
 
     if (is_dmono) {



More information about the ffmpeg-cvslog mailing list