[FFmpeg-cvslog] aacdec: don't return frames without data

Andreas Cadhalpun git at videolan.org
Tue Jun 2 00:50:08 CEST 2015


ffmpeg | branch: release/2.4 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Tue May 12 20:27:21 2015 +0200| [de648a11d8688ff4b0d02cf7e78bea870a5ea903] | committer: Michael Niedermayer

aacdec: don't return frames without data

Since commit 676a395a aac->frame->data is not necessarily allocated at
the end of aac_decode_frame_int if avctx->channels is 0.

In this case a bogus frame without any data, but non-zero nb_samples is
returned.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit ec38a1ba404b8cb8d71ccee2b8dcd6f3fcbde273)

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

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

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

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index e92f1a1..4a8c243 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -3021,6 +3021,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
             AV_WL32(side, 2*AV_RL32(side));
     }
 
+    if (!ac->frame->data[0] && samples) {
+        av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
+        err = AVERROR_INVALIDDATA;
+        goto fail;
+    }
+
     *got_frame_ptr = !!samples;
     if (samples) {
         ac->frame->nb_samples = samples;



More information about the ffmpeg-cvslog mailing list