[FFmpeg-cvslog] init_get_bits8: check byte_size against being positive
Michael Niedermayer
git at videolan.org
Mon Jan 14 16:36:26 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 14 16:22:41 2013 +0100| [ac73d3a12a33c5e4e6357d5f8824e19801663eb5] | committer: Michael Niedermayer
init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac73d3a12a33c5e4e6357d5f8824e19801663eb5
---
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 af7e156..1946c78 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -406,7 +406,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
int byte_size)
{
- if (byte_size > INT_MAX / 8)
+ if (byte_size > INT_MAX / 8 || byte_size < 0)
return AVERROR_INVALIDDATA;
return init_get_bits(s, buffer, byte_size * 8);
}
More information about the ffmpeg-cvslog
mailing list