summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavcodec/get_bits.h
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-10-01 10:27:24 -0500
committertrav90 <travawine@protonmail.ch>2018-10-01 10:27:24 -0500
commitebc8d7e3ca8723d815904e6fee6c088c659d6784 (patch)
tree9e3115f44e9a09b9c71d40d72c7d5c939b2278e2 /media/ffvpx/libavcodec/get_bits.h
parent8e8fcee4a55de171303ebe526d3cf051522111bf (diff)
downloadUXP-ebc8d7e3ca8723d815904e6fee6c088c659d6784.tar
UXP-ebc8d7e3ca8723d815904e6fee6c088c659d6784.tar.gz
UXP-ebc8d7e3ca8723d815904e6fee6c088c659d6784.tar.lz
UXP-ebc8d7e3ca8723d815904e6fee6c088c659d6784.tar.xz
UXP-ebc8d7e3ca8723d815904e6fee6c088c659d6784.zip
[ffvpx] Update ffvp9/ffvp8 to release 4.0.2
Diffstat (limited to 'media/ffvpx/libavcodec/get_bits.h')
-rw-r--r--media/ffvpx/libavcodec/get_bits.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/media/ffvpx/libavcodec/get_bits.h b/media/ffvpx/libavcodec/get_bits.h
index 0c7f5ff0c..56ef5f0cb 100644
--- a/media/ffvpx/libavcodec/get_bits.h
+++ b/media/ffvpx/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"
@@ -201,6 +202,13 @@ static inline int get_bits_count(const GetBitContext *s)
return s->index;
}
+/**
+ * Skips the specified number of bits.
+ * @param n the number of bits to skip,
+ * For the UNCHECKED_BITSTREAM_READER this must not cause the distance
+ * from the start to overflow int32_t. Staying within the bitstream + padding
+ * is sufficient, too.
+ */
static inline void skip_bits_long(GetBitContext *s, int n)
{
#if UNCHECKED_BITSTREAM_READER
@@ -428,7 +436,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;