Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-31 02:25:03 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 21:51:55 +0300
commit75cd59ec213c9282acd5271d0cbacc4505ae7a3b (patch)
tree3767ce8eb0141a8f6ef1ec0cb763f838d668f49f /libavformat/mov.c
parentf72580eb0faff9b68e377ec0c2d05be07372da21 (diff)
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>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 327a25bbdf..a709033abd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4418,7 +4418,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);