avcodec/indeo5: Fix infinite loop in skip_hdr_extension()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-06-15 03:17:11 +02:00
parent 7f4dfbd080
commit 103f9c261a
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}