aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-04-16 17:34:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-06-04 20:24:43 +0200
commit77d1ae5d943d029d125c69ec5f63720356e14933 (patch)
tree4c549e5a3cf56a860f16491f4779e9bee18a394c
parent40f962e56961c980c5282466efc50fc02a543aeb (diff)
downloadffmpeg-77d1ae5d943d029d125c69ec5f63720356e14933.tar.gz
avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()
Fixes: out of array access Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6682195323650048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 19b66b89da4b4ff086dc1fc79bbf540e82bdbcb4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tak.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tak.c b/libavcodec/tak.c
index d2670e00ff..053aa05b09 100644
--- a/libavcodec/tak.c
+++ b/libavcodec/tak.c
@@ -154,6 +154,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;