diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-12-04 20:11:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-13 23:39:50 +0200 |
commit | c63fed42930e40b08034c7b0db1139d2739771a8 (patch) | |
tree | 5b5ec885f3a46585d89e5de18be1cc1b500bf012 /libavformat | |
parent | 54d7297b338a6c507cb4f9c98789e5a2ec1fe0f5 (diff) | |
download | ffmpeg-c63fed42930e40b08034c7b0db1139d2739771a8.tar.gz |
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 <michael@niedermayer.cc>
(cherry picked from commit 59b4e7cbd87889c0bac710ac7f62782b637419a1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 3ec6e91098..aeb3cbbc7e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1700,6 +1700,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); |