aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 18:29:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-21 20:43:39 +0200
commit228f7c7eed04729d85aa8f4cdf1d753f7a8acbdc (patch)
tree26926e9474e9e5aa09fe697c697c5e7c4c9d6765 /libavcodec
parentba82b23a1d079530281ea3ac71eaaea9126c7429 (diff)
downloadffmpeg-228f7c7eed04729d85aa8f4cdf1d753f7a8acbdc.tar.gz
avcodec/dcadec: Check active_bands
Fixes CID1297594 part2 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit fc624ec9ba7e5c4e8d905ac10f605a43d123f95a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dcadec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index b2e5c7faa4..907e49b64d 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1823,8 +1823,13 @@ static int dca_xbr_parse_frame(DCAContext *s)
for(i = 0; i < num_chsets; i++) {
n_xbr_ch[i] = get_bits(&s->gb, 3) + 1;
k = get_bits(&s->gb, 2) + 5;
- for(j = 0; j < n_xbr_ch[i]; j++)
+ for(j = 0; j < n_xbr_ch[i]; j++) {
active_bands[i][j] = get_bits(&s->gb, k) + 1;
+ if (active_bands[i][j] > DCA_SUBBANDS) {
+ av_log(s->avctx, AV_LOG_ERROR, "too many active subbands (%d)\n", active_bands[i][j]);
+ return AVERROR_INVALIDDATA;
+ }
+ }
}
/* skip to the end of the header */