Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-03 23:46:05 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-06 14:54:16 +0300
commit516632359d5998234f9435f00c21ab5aede52067 (patch)
treea1909396ba21ad4d80eb573ed31554532e3a9460
parentc86f19e47c7ea0d5581cf182b2a757b5792be01e (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index aae96923d2..22508898ba 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -336,7 +336,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);