aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-13 23:30:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commit680f50938f22384bc33c19dfb401c8a87421c17f (patch)
tree40a4b9aea9a31e604c08c2aafec4114f245b4dea
parent0dc749187972332d26e13405df3b5a82da0fde2f (diff)
downloadffmpeg-680f50938f22384bc33c19dfb401c8a87421c17f.tar.gz
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> (cherry picked from commit ebf4bc629e6d0dbb4bb6725849bdd06456e4c8af) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/rmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index ba50839103..805d83dcc3 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -457,6 +457,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);