aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2022-06-27 21:52:35 +0200
committerMarton Balint <cus@passwd.hu>2022-07-06 23:37:29 +0200
commit03d81a044ad587ea83567f75dc36bc3d64278199 (patch)
treed4a25d122d274c279e817a1c5c7586d045e52849
parent7acc1241219f3b2810fe496c2cc34d79964c6d8f (diff)
downloadffmpeg-03d81a044ad587ea83567f75dc36bc3d64278199.tar.gz
avformat/mov: disallow a zero sample size in trun atoms
In order to not generate 0 sized packets or create a huge index table needlessly. Fixes: Timeout Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304 Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904 Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5d8b24368a..6eb631d45b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5179,6 +5179,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
distance++;
if (av_sat_add64(dts, sample_duration) != dts + (uint64_t)sample_duration)
return AVERROR_INVALIDDATA;
+ if (!sample_size)
+ return AVERROR_INVALIDDATA;
dts += sample_duration;
offset += sample_size;
sc->data_size += sample_size;