aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tmv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-10-09 00:07:32 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-10-15 18:54:37 +0200
commitb79fc7059600b28dce392fc20e5c8bd554c2fc95 (patch)
treea190fd164a9fc6d4955d59eab6d880a87921c488 /libavformat/tmv.c
parentfec6e84b18685abd2f8b3192bee560ff52c5220b (diff)
downloadffmpeg-b79fc7059600b28dce392fc20e5c8bd554c2fc95.tar.gz
avformat/tmv: Check video chunk size
This check matches the audio chunk check Fixes: Timeout Fixes: 62681/clusterfuzz-testcase-minimized-ffmpeg_dem_TMV_fuzzer-5299107876700160 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/tmv.c')
-rw-r--r--libavformat/tmv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index ea39954190..18105f764e 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -103,6 +103,10 @@ static int tmv_read_header(AVFormatContext *s)
char_cols = avio_r8(pb);
char_rows = avio_r8(pb);
tmv->video_chunk_size = char_cols * char_rows * 2;
+ if (!tmv->video_chunk_size) {
+ av_log(s, AV_LOG_ERROR, "invalid video chunk size\n");
+ return AVERROR_INVALIDDATA;
+ }
features = avio_r8(pb);
if (features & ~(TMV_PADDING | TMV_STEREO)) {