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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/343/head
Michael Niedermayer 5 years ago
parent c9c958051c
commit 87d54a6239
  1. 3
      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]);

Loading…
Cancel
Save