diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-15 03:17:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-15 03:50:30 +0200 |
commit | 103f9c261a68299125b99c542e20f5541051d2c9 (patch) | |
tree | 456fba7214cee3e3bda0773da4ab9c46ae4c88e6 /libavcodec/indeo5.c | |
parent | 7f4dfbd0809db97f6abafba7b9361278dfa2e994 (diff) | |
download | ffmpeg-103f9c261a68299125b99c542e20f5541051d2c9.tar.gz |
avcodec/indeo5: Fix infinite loop in skip_hdr_extension()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo5.c')
-rw-r--r-- | libavcodec/indeo5.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index a556fc787e..75f79ad9d3 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -289,14 +289,18 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx) * * @param[in,out] gb the GetBit context */ -static inline void skip_hdr_extension(GetBitContext *gb) +static inline int skip_hdr_extension(GetBitContext *gb) { int i, len; do { len = get_bits(gb, 8); + if (8*len > get_bits_left(gb)) + return AVERROR_INVALIDDATA; for (i = 0; i < len; i++) skip_bits(gb, 8); } while(len); + + return 0; } |