diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-24 01:38:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-18 01:16:03 +0200 |
commit | 26fcff1eb40db93809f20c60dab9c1541a4a1bbd (patch) | |
tree | 32a5067bbecf45b98a5921b6153c4dc8a773d5ca | |
parent | e26ae6e6cec85423851172d3a19d8df6ab8c03de (diff) | |
download | ffmpeg-26fcff1eb40db93809f20c60dab9c1541a4a1bbd.tar.gz |
avcodec/get_bits: Make sure the input bitstream with padding can be addressed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e529fe7633762cb26a665fb6dee3be29b15285cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/get_bits.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 0c7f5ff0c6..d7cf286378 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -32,6 +32,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/avassert.h" +#include "avcodec.h" #include "mathops.h" #include "vlc.h" @@ -428,7 +429,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, int buffer_size; int ret = 0; - if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) { + if (bit_size >= INT_MAX - FFMAX(7, AV_INPUT_BUFFER_PADDING_SIZE*8) || bit_size < 0 || !buffer) { bit_size = 0; buffer = NULL; ret = AVERROR_INVALIDDATA; |