mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +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:
parent
97c281d5b7
commit
9ebe6e3910
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user