Commit bd46e78a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/put_bits: Assert that size in set_put_bits_buffer_size() does not cause integer overflows

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 291ad5cc
...@@ -252,6 +252,7 @@ static inline void skip_put_bits(PutBitContext *s, int n) ...@@ -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) 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->buf_end = s->buf + size;
s->size_in_bits = 8*size; s->size_in_bits = 8*size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment