Commit 87d54a62 authored by Michael Niedermayer's avatar 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/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c9c95805
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment