Module: libav
Branch: release/0.8
Commit: 2fb0a52e70fa2b6df8d303713f9eafc393a0a145

Author:    Anton Khirnov <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Thu Feb 14 08:47:17 2013 +0100

lagarith: avoid infinite loop in lag_rac_refill()

range == 0 happens with corrupted files

CC:[email protected]
(cherry picked from commit de6dfa2bb82df916a67e5036b0ef96a944781ed3)

Signed-off-by: Reinhard Tartler <[email protected]>
(cherry picked from commit 8bce2c60b8ebc31899d576dde3bbe6205faae97d)

---

 libavcodec/lagarithrac.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h
index b942199..1c8093f 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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to