diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-02-08 20:04:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-06-17 01:54:05 +0200 |
commit | b0cac7082d8a3ff2d4f039af01b45c48bb578de7 (patch) | |
tree | d02cbb5fabe6cdd7891e4ebc46bc1a7a09994789 /libavformat | |
parent | 02699490c14e86105104940c009953081f69432c (diff) | |
download | ffmpeg-b0cac7082d8a3ff2d4f039af01b45c48bb578de7.tar.gz |
avformat/demux: Count EAGAIN as 100 bytes in relation to read limit in avformat_find_stream_info()
Fixes: Timeout
Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304
Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/demux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/demux.c b/libavformat/demux.c index 57720f4311..e121253dfd 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -2615,8 +2615,10 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) /* NOTE: A new stream can be added there if no header in file * (AVFMTCTX_NOHEADER). */ ret = read_frame_internal(ic, pkt1); - if (ret == AVERROR(EAGAIN)) + if (ret == AVERROR(EAGAIN)) { + read_size += 100; continue; + } if (ret < 0) { /* EOF or error*/ |