diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-02-14 08:47:17 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-02-23 09:16:32 +0100 |
commit | de6dfa2bb82df916a67e5036b0ef96a944781ed3 (patch) | |
tree | 2cd3d1397390067ddc280028a66cdcb4e15561b9 /libavcodec/lagarithrac.h | |
parent | f935aca44c674d30e3ed940ef73bbad1228a5855 (diff) | |
download | ffmpeg-de6dfa2bb82df916a67e5036b0ef96a944781ed3.tar.gz |
lagarith: avoid infinite loop in lag_rac_refill()
range == 0 happens with corrupted files
CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/lagarithrac.h')
-rw-r--r-- | libavcodec/lagarithrac.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h index aa36d38f85..e4f066e445 100644 --- a/libavcodec/lagarithrac.h +++ b/libavcodec/lagarithrac.h @@ -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; |