mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
dcadec: skip QMF on unused channels
When the extra rear channel is present but unused, the s->channel_order_tab[] value for that channel is -1. The QMF can be skipped for the extra channel, and doing so avoids an out-of-array read on s->samples_chanptr[]. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
parent
2fe0094e0b
commit
5d47850bbd
@ -1279,9 +1279,10 @@ static int dca_filter_channels(DCAContext *s, int block_index)
|
|||||||
for (k = 0; k < s->prim_channels; k++) {
|
for (k = 0; k < s->prim_channels; k++) {
|
||||||
/* static float pcm_to_double[8] = { 32768.0, 32768.0, 524288.0, 524288.0,
|
/* static float pcm_to_double[8] = { 32768.0, 32768.0, 524288.0, 524288.0,
|
||||||
0, 8388608.0, 8388608.0 };*/
|
0, 8388608.0, 8388608.0 };*/
|
||||||
qmf_32_subbands(s, k, subband_samples[k],
|
if (s->channel_order_tab[k] >= 0)
|
||||||
s->samples_chanptr[s->channel_order_tab[k]],
|
qmf_32_subbands(s, k, subband_samples[k],
|
||||||
M_SQRT1_2 / 32768.0 /* pcm_to_double[s->source_pcm_res] */);
|
s->samples_chanptr[s->channel_order_tab[k]],
|
||||||
|
M_SQRT1_2 / 32768.0 /* pcm_to_double[s->source_pcm_res] */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Down mixing */
|
/* Down mixing */
|
||||||
|
Loading…
Reference in New Issue
Block a user