diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-06-03 22:46:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:49 +0200 |
commit | 226d608e952f65b0ffd11708a9ed8e8cd1fcf831 (patch) | |
tree | 87fb2e98defe3f276855ce2574e850be3cfc1d9e | |
parent | 2e36b0d55a9d2fc6e117972372e9e5d3382c3dd7 (diff) | |
download | ffmpeg-226d608e952f65b0ffd11708a9ed8e8cd1fcf831.tar.gz |
avformat/rpl: Check for EOF and zero framesize
Fixes: Infinite loop
Fixes: 34751/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5439330800762880
Fixes: 34774/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5851571660390400
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 a0a4a527c3b0819368d9b148542bb7663f39df79)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/rpl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 0b97699ca3..a7665cf421 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -309,7 +309,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) avio_skip(pb, 4); /* flags */ frame_size = avio_rl32(pb); - if (avio_seek(pb, -8, SEEK_CUR) < 0) + if (avio_feof(pb) || avio_seek(pb, -8, SEEK_CUR) < 0 || !frame_size) return AVERROR(EIO); ret = av_get_packet(pb, pkt, frame_size); |