Commit ac73d3a1 authored by Michael Niedermayer's avatar Michael Niedermayer

init_get_bits8: check byte_size against being positive

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c29c7c14
......@@ -406,7 +406,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
int byte_size)
{
if (byte_size > INT_MAX / 8)
if (byte_size > INT_MAX / 8 || byte_size < 0)
return AVERROR_INVALIDDATA;
return init_get_bits(s, buffer, byte_size * 8);
}
......
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