[FFmpeg-cvslog] init_get_bits: fix off by 1 error

Michael Niedermayer git at videolan.org
Sun Jan 20 01:12:08 CET 2013


ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 14 16:29:27 2013 +0100| [1135928903325f48c0cedf1e9b793061965c1558] | committer: Michael Niedermayer

init_get_bits: fix off by 1 error

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7980cca05c7c72fc8b0be4268eea2e156e538228)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1135928903325f48c0cedf1e9b793061965c1558
---

 libavcodec/get_bits.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 964456e..89df381 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -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;



More information about the ffmpeg-cvslog mailing list