Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 19:29:40 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 03:13:12 +0300
commitc01f5517280c389cd823e9e1b5d1cf979040bd61 (patch)
tree7a38f7bd4597f1022a85a2e6e0551688590b4d23
parenta3d05bf6be2e97092ce2ded0a849d9150aac82f2 (diff)
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>
-rw-r--r--libavcodec/dcadec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index f68a6f2982..bb5a6d113b 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1767,8 +1767,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 */