From db794291a29546b93c3b39dc33b3f9a3bcf9e315 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= <mans@mansr.com>
Date: Sun, 1 Mar 2009 12:11:07 +0000
Subject: [PATCH] SVQ3: Fix decoding with A32_BITSTREAM_READER

svq3_decode_slice_header() modifies the buffer used by the bitstream
reader.  Some of the bitstream readers cache a few bytes of data, which
must be flushed after such a modification.  Calling skip_bits_long(gb, 0)
achieves this.

Originally committed as revision 17680 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/svq3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 6dc37abb71e..bef7075a262 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -724,6 +724,7 @@ static int svq3_decode_slice_header(H264Context *h)
             memcpy((uint8_t *) &s->gb.buffer[get_bits_count(&s->gb) >> 3],
                    &s->gb.buffer[s->gb.size_in_bits >> 3], (length - 1));
         }
+        skip_bits_long(&s->gb, 0);
     }
 
     if ((i = svq3_get_ue_golomb(&s->gb)) == INVALID_VLC || i >= 3){
-- 
GitLab