diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-10 19:00:15 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-12 04:34:49 +0200 |
commit | 3802833bc1f79775a1547c5e427fed6e92b77e53 (patch) | |
tree | e853c288e818948c5678a932386e42390775cd95 /libavcodec/dcadec.c | |
parent | f261e508459e28beca59868a878e1519a44bb678 (diff) | |
download | ffmpeg-3802833bc1f79775a1547c5e427fed6e92b77e53.tar.gz |
dca: Respect the current limits in the downmixing capabilities
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/dcadec.c')
-rw-r--r-- | libavcodec/dcadec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index de24e4e62b..9b00d30b74 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -807,6 +807,12 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) "Invalid channel mode %d\n", am); return AVERROR_INVALIDDATA; } + if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) { + avpriv_request_sample(s->avctx, "Downmixing %d channels", + s->prim_channels); + return AVERROR_PATCHWELCOME; + } + 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]; |