[FFmpeg-cvslog] avformat/rmdec: Check for EOF in index packet reading

Michael Niedermayer git at videolan.org
Sat Nov 21 23:10:19 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Nov 13 23:30:47 2020 +0100| [ebf4bc629e6d0dbb4bb6725849bdd06456e4c8af] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebf4bc629e6d0dbb4bb6725849bdd06456e4c8af
---

 libavformat/rmdec.c | 2 ++
 1 file changed, 2 insertions(+)

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);



More information about the ffmpeg-cvslog mailing list