[FFmpeg-cvslog] avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()

Michael Niedermayer git at videolan.org
Mon Oct 30 02:09:42 EET 2023


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun Apr 16 17:34:16 2023 +0200| [f174aa713455bb48f4de22df223f17d0a851660f] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 19b66b89da4b4ff086dc1fc79bbf540e82bdbcb4)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f174aa713455bb48f4de22df223f17d0a851660f
---

 libavcodec/tak.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/tak.c b/libavcodec/tak.c
index 7221a80094..a19b2779e2 100644
--- a/libavcodec/tak.c
+++ b/libavcodec/tak.c
@@ -168,6 +168,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;



More information about the ffmpeg-cvslog mailing list