summaryrefslogtreecommitdiff
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-29 06:10:17 +0100
committerJustin Ruggles <justin.ruggles@gmail.com>2012-09-17 14:17:27 -0400
commit5b051ec3bdc78f3d89e8d1425674cde8fd6c9ccc (patch)
treeba4eb68cd0f8a2ec4eb6b1a67703bd6bf980fed8 /libavcodec/alsdec.c
parent9853e41aa0a6cfff629ff7009685eb8bf8d64e7f (diff)
alsdec: Check that quantized parcor coeffs are within range.
ALS spec: 11.6.3.1.1 Quantization and encoding of parcor coefficients ... In all cases the resulting quantized values ak are restricted to the range [-64,63]. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index defe3c4850..b4bc41bee1 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -705,6 +705,10 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
int rice_param = parcor_rice_table[sconf->coef_table][k][1];
int offset = parcor_rice_table[sconf->coef_table][k][0];
quant_cof[k] = decode_rice(gb, rice_param) + offset;
+ if (quant_cof[k] < -64 || quant_cof[k] > 63) {
+ av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range\n", quant_cof[k]);
+ return AVERROR_INVALIDDATA;
+ }
}
// read coefficients 20 to 126