diff mbox series

[FFmpeg-devel,1/3] avformat/tmv: Check video chunk size

Message ID 20231011181015.6433-1-michael@niedermayer.cc
State Accepted
Commit b79fc7059600b28dce392fc20e5c8bd554c2fc95
Headers show
Series [FFmpeg-devel,1/3] avformat/tmv: Check video chunk size | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Oct. 11, 2023, 6:10 p.m. UTC
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>
---
 libavformat/tmv.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer Oct. 15, 2023, 10:54 p.m. UTC | #1
On Wed, Oct 11, 2023 at 08:10:13PM +0200, Michael Niedermayer wrote:
> 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>
> ---
>  libavformat/tmv.c | 4 ++++
>  1 file changed, 4 insertions(+)

will apply

[...]
diff mbox series

Patch

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)) {