summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2021-12-04 20:11:35 +0100
committerMichael Niedermayer <[email protected]>2021-12-06 22:06:48 +0100
commitd403446d87abf5cc4d5aa6750451a33a75d78d89 (patch)
treef4bdbe77c56b6859c8284d6295495885bf142239
parentdb26d829edf83b8cb730d50831770c508fc6436f (diff)
avformat/mov: Check for EOF in mov_read_glbl()
Fixes: Infinite loop Fixes: 41351/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5433895854669824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 59b4e7cbd87889c0bac710ac7f62782b637419a1) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 52359b0555..a2fd9b8510 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1502,6 +1502,8 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
// wrap a whole fiel atom inside of a glbl atom.
unsigned size = avio_rb32(pb);
unsigned type = avio_rl32(pb);
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
avio_seek(pb, -8, SEEK_CUR);
if (type == MKTAG('f','i','e','l') && size == atom.size)
return mov_read_default(c, pb, atom);