1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-22 09:15:06 +02:00

ffv1: fix integer overflow in quant table initialization

Fixes part of Ticket1372

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-02 02:37:36 +02:00
parent 97c281d5b7
commit 9ebe6e3910

View File

@ -1651,9 +1651,9 @@ static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
memset(state, 128, sizeof(state));
for(v=0; i<128 ; v++){
int len= get_symbol(c, state, 0) + 1;
unsigned len= get_symbol(c, state, 0) + 1;
if(len + i > 128) return -1;
if(len > 128 - i) return -1;
while(len--){
quant_table[i] = scale*v;