summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/indeo5.c6
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;
}