diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-31 01:25:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:46 +0100 |
commit | b1f0a2bdefa9519a0aea33cfba7ef8e18035ad2c (patch) | |
tree | 1dc080df96b792468a83c315ec9f0309fb25bd19 | |
parent | c888b34b1c55e41826a9692cf9707dc0959d55f8 (diff) | |
download | ffmpeg-b1f0a2bdefa9519a0aea33cfba7ef8e18035ad2c.tar.gz |
avformat/mov: Check for EOF in mov_read_meta()
Fixes: Timeout (195sec -> 2ms)
Fixes: 16735/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5090676403863552
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 093d1f42507e07d9acb43a8a3135e4ebe3530fe2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index ac69c41ebb..9d6aa5b01b 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4063,7 +4063,10 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) { while (atom.size > 8) { - uint32_t tag = avio_rl32(pb); + uint32_t tag; + if (avio_feof(pb)) + return AVERROR_EOF; + tag = avio_rl32(pb); atom.size -= 4; if (tag == MKTAG('h','d','l','r')) { avio_seek(pb, -8, SEEK_CUR); |