Browse code

avcodec/put_bits: Assert buf_ptr in flush_put_bits()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3ef5de0f19774e2c3dd9b08ba2e8ab7241a4862a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2016/01/19 01:13:55
Showing 1 changed files
... ...
@@ -88,7 +88,7 @@ static inline void flush_put_bits(PutBitContext *s)
88 88
         s->bit_buf <<= s->bit_left;
89 89
 #endif
90 90
     while (s->bit_left < 32) {
91
-        /* XXX: should test end of buffer */
91
+        av_assert0(s->buf_ptr < s->buf_end);
92 92
 #ifdef BITSTREAM_WRITER_LE
93 93
         *s->buf_ptr++ = s->bit_buf;
94 94
         s->bit_buf  >>= 8;