summaryrefslogtreecommitdiff
path: root/libavcodec/aacdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-08 01:45:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-08 02:28:44 +0200
commit153d23ee39db0304bd2a9e7b26eef9562be07eb8 (patch)
tree1f22d63e542ae32e6f98ac3062bb6f01a271362e /libavcodec/aacdec.c
parent476692abdb3207b722c2cbbd9ea3720004aae440 (diff)
parentbc76c46943272515805d7ac48ca39f14826d1fed (diff)
Merge commit 'bc76c46943272515805d7ac48ca39f14826d1fed'
* commit 'bc76c46943272515805d7ac48ca39f14826d1fed': aac: Wait to know the channels before allocating frame Conflicts: libavcodec/aacdec.c See: 676a395ab903cac623c5d6ddd0928c789e08a59e Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r--libavcodec/aacdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index eab889f789..2d12512671 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2987,6 +2987,9 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (avctx->debug & FF_DEBUG_STARTCODE)
av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
+ if (!avctx->channels && elem_type != TYPE_PCE)
+ goto fail;
+
if (elem_type < TYPE_DSE) {
if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
@@ -3076,6 +3079,11 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
}
}
+ if (!avctx->channels) {
+ *got_frame_ptr = 0;
+ return 0;
+ }
+
spectral_to_sample(ac);
multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;