summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-10-25 15:42:08 +0200
committerLuca Barbato <lu_zero@gentoo.org>2001-01-01 01:06:41 +0100
commit22f7942fe7d7349e3562ac68fa101d9efec522df (patch)
tree18d1c925d08877ca9df587eb320ee807f0061b26 /libavcodec/ffv1dec.c
parentdcdfb8ede3580cde6acc1c6ca889ad3b610d75dc (diff)
ffv1: set the range coder state in decode_slice_header
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index f5f7a8f2f5..c5329b42ad 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -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;