dca: dont overread dca_default_coeffs.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-02-29 21:14:17 +01:00
parent 51db9a97e9
commit d7bce4a274
1 changed files with 4 additions and 0 deletions

View File

@ -801,10 +801,14 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
}
} else {
int am = s->amode & DCA_CHANNEL_MASK;
if (am < 16) {
for (j = base_channel; j < s->prim_channels; j++) {
s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
}
} else {
av_log(s->avctx, AV_LOG_WARNING, "amode > 15 default downmix_coef unsupported\n");
}
}
}