[FFmpeg-devel] [PATCH] avcodec/get_bits: consider bit_size of 0 an error

Paul B Mahol onemda at gmail.com
Mon Oct 28 17:52:27 CET 2013


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 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 4ddb088..32715d8 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -408,7 +408,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 - 7 || bit_size <= 0 || !buffer) {
         buffer_size = bit_size = 0;
         buffer      = NULL;
         ret         = AVERROR_INVALIDDATA;
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list