diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index f60060adb5..cd7bbb0adb 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) {