diff mbox series

[FFmpeg-devel,2/2] avformat/rmdec: Check for EOF in index packet reading

Message ID 20201114101815.24489-2-michael@niedermayer.cc
State Accepted
Commit ebf4bc629e6d0dbb4bb6725849bdd06456e4c8af
Headers show
Series [FFmpeg-devel,1/2] avcodec/cbs_h265_syntax_template: Better check for num_long_term_sps | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Nov. 14, 2020, 10:18 a.m. UTC
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>
---
 libavformat/rmdec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer Nov. 21, 2020, 7:50 p.m. UTC | #1
On Sat, Nov 14, 2020 at 11:18:15AM +0100, Michael Niedermayer wrote:
> 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>
> ---
>  libavformat/rmdec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
diff mbox series

Patch

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