Module: libav
Branch: master
Commit: de6dfa2bb82df916a67e5036b0ef96a944781ed3

Author:    Anton Khirnov <[email protected]>
Committer: Anton Khirnov <[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]

---

 libavcodec/lagarithrac.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h
index aa36d38..e4f066e 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