[FFmpeg-cvslog] avformat/tty: Fix division by 0 in probe
Michael Niedermayer
git at videolan.org
Mon Feb 10 00:34:07 EET 2020
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb 5 22:22:30 2020 +0100| [87d54a62396830eff232051ac38b5c273ca2e38a] | committer: Michael Niedermayer
avformat/tty: Fix division by 0 in probe
Fixes: division by zero
Fixes: 20436/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5763229752229888
Fixes: 20503/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4841641154445312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87d54a62396830eff232051ac38b5c273ca2e38a
---
libavformat/tty.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/tty.c b/libavformat/tty.c
index 60f7e9f87e..854a23c500 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -53,6 +53,9 @@ static int read_probe(const AVProbeData *p)
{
int cnt = 0;
+ if (!p->buf_size)
+ return 0;
+
for (int i = 0; i < p->buf_size; i++)
cnt += !!isansicode(p->buf[i]);
More information about the ffmpeg-cvslog
mailing list