diff --git a/libavcodec/tak.c b/libavcodec/tak.c index 628609b71b..99678e9887 100644 --- a/libavcodec/tak.c +++ b/libavcodec/tak.c @@ -175,6 +175,9 @@ int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, if (ti->flags & TAK_FRAME_FLAG_HAS_METADATA) return AVERROR_INVALIDDATA; + if (get_bits_left(gb) < 24) + return AVERROR_INVALIDDATA; + skip_bits(gb, 24); return 0;