init_get_bits: fix off by 1 error
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 14 Jan 2013 15:29:27 +0000 (16:29 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 19 Jan 2013 16:59:23 +0000 (17:59 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7980cca05c7c72fc8b0be4268eea2e156e538228)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/get_bits.h

index 964456e..89df381 100644 (file)
@@ -379,7 +379,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) {
+    if (bit_size >= INT_MAX - 7 || bit_size < 0) {
         buffer_size = bit_size = 0;
         buffer = NULL;
         ret = AVERROR_INVALIDDATA;