avcodec/put_bits: Assert that size in set_put_bits_buffer_size() does not cause integ...
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 25 May 2015 03:31:26 +0000 (05:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 25 May 2015 03:31:26 +0000 (05:31 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/put_bits.h

index 1a6f0af..5b1bc8b 100644 (file)
@@ -252,6 +252,7 @@ static inline void skip_put_bits(PutBitContext *s, int n)
  */
 static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
 {
+    av_assert0(size <= INT_MAX/8 - 32);
     s->buf_end = s->buf + size;
     s->size_in_bits = 8*size;
 }