Commit 8f152480 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/aacdec_template: Allow duplicated elements

Such streams are invalid according to
4.5.2.1 Top level payloads for the audio object types AAC main, AAC SSR, AAC LC and AAC LTP
4.5.2.1.1 Definitions
...cIn the raw_data_block(), several instances of the
same syntactic element may occur, but must have a different 4 bit
element_instance_tag, except for data_stream_element()'s and
fill_element()'s.

Fixes: Ticket7477
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f7affc6f
......@@ -3161,12 +3161,15 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (elem_type < TYPE_DSE) {
if (che_presence[elem_type][elem_id]) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d duplicate\n",
int error = che_presence[elem_type][elem_id] > 1;
av_log(ac->avctx, error ? AV_LOG_ERROR : AV_LOG_DEBUG, "channel element %d.%d duplicate\n",
elem_type, elem_id);
err = AVERROR_INVALIDDATA;
goto fail;
if (error) {
err = AVERROR_INVALIDDATA;
goto fail;
}
}
che_presence[elem_type][elem_id] = 1;
che_presence[elem_type][elem_id]++;
if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment