mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
huffyuv: error out on bit overrun.
On EOF, get_bits() will continuously return 0, causing an infinite loop. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
0733375059
commit
84c202cc37
@ -184,7 +184,7 @@ static int read_len_table(uint8_t *dst, GetBitContext *gb){
|
|||||||
if(repeat==0)
|
if(repeat==0)
|
||||||
repeat= get_bits(gb, 8);
|
repeat= get_bits(gb, 8);
|
||||||
//printf("%d %d\n", val, repeat);
|
//printf("%d %d\n", val, repeat);
|
||||||
if(i+repeat > 256) {
|
if(i+repeat > 256 || get_bits_left(gb) < 0) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n");
|
av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user