Browse Source

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>
tags/n4.4
Michael Niedermayer 5 years ago
parent
commit
ebf4bc629e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/rmdec.c

+ 2
- 0
libavformat/rmdec.c View File

@@ -458,6 +458,8 @@ static int rm_read_index(AVFormatContext *s)
} }


for (n = 0; n < n_pkts; n++) { for (n = 0; n < n_pkts; n++) {
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
avio_skip(pb, 2); avio_skip(pb, 2);
pts = avio_rb32(pb); pts = avio_rb32(pb);
pos = avio_rb32(pb); pos = avio_rb32(pb);


Loading…
Cancel
Save