avcodec/put_bits: Assert buf_ptr in flush_put_bits()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 18 Jan 2016 16:13:55 +0000 (17:13 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 28 Jan 2016 14:53:53 +0000 (15:53 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3ef5de0f19774e2c3dd9b08ba2e8ab7241a4862a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/put_bits.h

index 0db8a03..68ed391 100644 (file)
@@ -105,7 +105,7 @@ static inline void flush_put_bits(PutBitContext *s)
         s->bit_buf <<= s->bit_left;
 #endif
     while (s->bit_left < 32) {
-        /* XXX: should test end of buffer */
+        av_assert0(s->buf_ptr < s->buf_end);
 #ifdef BITSTREAM_WRITER_LE
         *s->buf_ptr++ = s->bit_buf;
         s->bit_buf  >>= 8;