diff --git a/libfaad/syntax.c b/libfaad/syntax.c index f8e808c2..e7fb1138 100644 --- a/libfaad/syntax.c +++ b/libfaad/syntax.c @@ -344,6 +344,12 @@ static void decode_sce_lfe(NeAACDecStruct *hDecoder, can become 2 when some form of Parametric Stereo coding is used */ + if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) { + /* element inconsistency */ + hInfo->error = 21; + return; + } + /* save the syntax element id */ hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele; @@ -395,6 +401,12 @@ static void decode_cpe(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo, bitfi return; } + if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) { + /* element inconsistency */ + hInfo->error = 21; + return; + } + /* save the syntax element id */ hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;