aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-14 08:47:17 +0100
committerReinhard Tartler <siretart@tauware.de>2014-02-28 23:07:40 -0500
commit2fb0a52e70fa2b6df8d303713f9eafc393a0a145 (patch)
tree71291dbfe607321a6448eaae69debd52d7a8c149
parent2c1d84499bfe06d75e9160b824eeffd9f5587337 (diff)
downloadffmpeg-2fb0a52e70fa2b6df8d303713f9eafc393a0a145.tar.gz
lagarith: avoid infinite loop in lag_rac_refill()
range == 0 happens with corrupted files CC:libav-stable@libav.org (cherry picked from commit de6dfa2bb82df916a67e5036b0ef96a944781ed3) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit 8bce2c60b8ebc31899d576dde3bbe6205faae97d)
-rw-r--r--libavcodec/lagarithrac.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h
index b9421993a4..1c8093ff38 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;