[FFmpeg-cvslog] alsdec: Check that quantized parcor coeffs are within range.

Michael Niedermayer git at videolan.org
Thu Oct 25 17:10:44 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 29 06:10:17 2012 +0100| [0f81057c125139b8b2fc00ff61b94f6c1d2f4c59] | committer: Reinhard Tartler

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 at gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>
(cherry picked from commit 5b051ec3bdc78f3d89e8d1425674cde8fd6c9ccc)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f81057c125139b8b2fc00ff61b94f6c1d2f4c59
---

 libavcodec/alsdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 8932996..eec6a16 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



More information about the ffmpeg-cvslog mailing list