ffv1: set the range coder state in decode_slice_header
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 25 Oct 2012 13:42:08 +0000 (15:42 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 1 Jan 2001 00:06:41 +0000 (01:06 +0100)
libavcodec/ffv1dec.c

index f5f7a8f..c5329b4 100644 (file)
@@ -273,7 +273,12 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
     unsigned ps, i, context_count;
     memset(state, 128, sizeof(state));
 
-    av_assert0(f->version > 2);
+    if (fs->ac > 1) {
+        for (i = 1; i < 256; i++) {
+            fs->c.one_state[i]        = f->state_transition[i];
+            fs->c.zero_state[256 - i] = 256 - fs->c.one_state[i];
+        }
+    }
 
     fs->slice_x      = get_symbol(c, state, 0) * f->width;
     fs->slice_y      = get_symbol(c, state, 0) * f->height;