avformat/tty: make probing strict for first 8 bytes

This commit is contained in:
Paul B Mahol 2020-02-02 13:51:49 +01:00
parent 5ad1c1a18a
commit 9216ad2e46

View File

@ -56,7 +56,13 @@ static int read_probe(const AVProbeData *p)
if (!p->buf_size)
return 0;
for (int i = 0; i < p->buf_size; i++)
for (int i = 0; i < 8 && i < p->buf_size; i++)
cnt += !!isansicode(p->buf[i]);
if (cnt != 8)
return 0;
for (int i = 8; i < p->buf_size; i++)
cnt += !!isansicode(p->buf[i]);
return (cnt * 100LL / p->buf_size) * (cnt > 400) *