summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-13 23:30:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-11-21 22:09:51 +0100
commitebf4bc629e6d0dbb4bb6725849bdd06456e4c8af (patch)
treede453e63f70e0a7e7db620fe1cb8cfb60ebd35a3 /libavformat/rmdec.c
parent7ce7d33d1537bebe3e11b4046466d6c694f2e9c7 (diff)
avformat/rmdec: Check for EOF in index packet reading
Fixes: Timeout(>10sec -> 1ms) Fixes: 27284/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6304211110985728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 0c3ac4e47f..004c62086d 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -458,6 +458,8 @@ static int rm_read_index(AVFormatContext *s)
}
for (n = 0; n < n_pkts; n++) {
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
avio_skip(pb, 2);
pts = avio_rb32(pb);
pos = avio_rb32(pb);