diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-13 23:30:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | aa11e4c712231bef00419b6181d1c3dccdc4eee8 (patch) | |
tree | 146c928ecd010c361f8d291cbf6a0be4fb9722ff | |
parent | 1dfa422f73f98cc0b95cc1c2e571b6112be445b5 (diff) | |
download | ffmpeg-aa11e4c712231bef00419b6181d1c3dccdc4eee8.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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index e1c846b603..1b53245a04 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -455,6 +455,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); |