lagarith: avoid infinite loop in lag_rac_refill()

range == 0 happens with corrupted files

CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-02-14 08:47:17 +01:00
parent f935aca44c
commit de6dfa2bb8
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,9 @@ static inline uint8_t lag_get_rac(lag_rac *l)
l->range -= range_scaled * l->prob[255];
}
if (!l->range)
l->range = 0x80;
l->low -= range_scaled * l->prob[val];
return val;