diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 16:22:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-19 17:59:21 +0100 |
commit | bd531038e8affa6387d2d7dadd20d907e5791ab5 (patch) | |
tree | 1f881e45836c96cc78cd037505766be5f473441e | |
parent | 90da0cb60e1cad447fc34b89a3641474f6cabb4c (diff) | |
download | ffmpeg-bd531038e8affa6387d2d7dadd20d907e5791ab5.tar.gz |
init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ac73d3a12a33c5e4e6357d5f8824e19801663eb5)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/get_bits.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index af7e156e59..1946c78af2 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -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); } |