mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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 a0a4a527c3
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
350bedf7e2
commit
57f68127da
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user