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

dcadec: fix global array overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bdeb54e1
...@@ -805,7 +805,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) ...@@ -805,7 +805,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
"Invalid channel mode %d\n", am); "Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
for (j = base_channel; j < s->prim_channels; j++) { for (j = base_channel; j < FFMIN(s->prim_channels, FF_ARRAY_ELEMS(dca_default_coeffs[am])); j++) {
s->downmix_coef[j][0] = dca_default_coeffs[am][j][0]; s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
s->downmix_coef[j][1] = dca_default_coeffs[am][j][1]; s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
} }
......
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