summaryrefslogtreecommitdiff
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-16 13:12:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-16 13:13:34 +0100
commit18f94df8af04f2c02a25a7dec512289feff6517f (patch)
tree87de31eac8b85cbeed3f6aa3b08c77974635dfe7 /libavcodec/alsdec.c
parentec482e738ddcb90b156cf306eb1911f7038efa19 (diff)
avcodec/alsdec: check predictor order against block length
Fixes out of array access Fixes: abd3c041acbcb816be113455d138166b-asan_heap-oob_b11634_3707_cov_1707137151_als_05_2ch48k16b.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index c42b2aee19..27d190241c 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -688,7 +688,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
} else {
*bd->opt_order = sconf->max_order;
}
-
+ if (*bd->opt_order > bd->block_length) {
+ *bd->opt_order = bd->block_length;
+ av_log(avctx, AV_LOG_ERROR, "Predictor order too large.\n");
+ return AVERROR_INVALIDDATA;
+ }
opt_order = *bd->opt_order;
if (opt_order) {