aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rpl.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-03 22:46:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:54:52 +0200
commitd9c4cfba9f3d8634cfb9ecbc33a7771871885c01 (patch)
tree216602e3db8226bbc1193e3f218066fe014d7caa /libavformat/rpl.c
parent68765c25cd1534e685477c7bc21dbed5be979a8d (diff)
downloadffmpeg-d9c4cfba9f3d8634cfb9ecbc33a7771871885c01.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>
Diffstat (limited to 'libavformat/rpl.c')
-rw-r--r--libavformat/rpl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index 1b91cf4385..6b83c355a8 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -324,7 +324,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);