diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 86f28974344d3238672ae9f2ffac47b79201b215..9eef531d59198839fc158dd83b1d9a689f8cd48a 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -249,10 +249,9 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
     else{
         int i, e, a;
         e= 0;
-        while(get_rac(c, state+1 + e)){ //1..10
+        while(get_rac(c, state+1 + e) && e<9){ //1..10
             e++;
         }
-        assert(e<=9);
 
         a= 1;
         for(i=e-1; i>=0; i--){