mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c29c7c1470
commit
ac73d3a12a
@ -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,
|
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
|
||||||
int byte_size)
|
int byte_size)
|
||||||
{
|
{
|
||||||
if (byte_size > INT_MAX / 8)
|
if (byte_size > INT_MAX / 8 || byte_size < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
return init_get_bits(s, buffer, byte_size * 8);
|
return init_get_bits(s, buffer, byte_size * 8);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user