You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/put_bits: Assert that size in set_put_bits_buffer_size() does not cause integer overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user