Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-14 19:22:41 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-01-14 19:35:41 +0400
commitac73d3a12a33c5e4e6357d5f8824e19801663eb5 (patch)
tree59daa796d948d66b04ffe6b40b2bb0ad3b6ab719 /libavcodec/get_bits.h
parentc29c7c1470f98f8e66752fb09c44ded625e9a991 (diff)
init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index af7e156e59..1946c78af2 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);
}