aacdec: free frame buffer if no audio was decoded
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 4 May 2013 09:17:00 +0000 (11:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 May 2013 11:20:19 +0000 (13:20 +0200)
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@gmx.at>
libavcodec/aacdec.c

index f60060a..cd7bbb0 100644 (file)
@@ -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) {