diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-29 06:10:17 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-01-04 07:43:38 +0100 |
commit | e3e369f6962cb73ead3ca5d49a5cc313eb85e5fc (patch) | |
tree | ce64f00a47477e51e90ecb61f7426dd496d04f56 /libavcodec | |
parent | aa45b90804ab21175b8c116bd8e5eb4b4e85fbcb (diff) | |
download | ffmpeg-e3e369f6962cb73ead3ca5d49a5cc313eb85e5fc.tar.gz |
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>
(cherry picked from commit 5b051ec3bdc78f3d89e8d1425674cde8fd6c9ccc)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alsdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index cfe8fd37cb..4f4176ecee 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -704,6 +704,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 |