mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-03 21:42:09 +00:00
avformat/tty: make probing strict for first 8 bytes
This commit is contained in:
parent
5ad1c1a18a
commit
9216ad2e46
@ -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) *
|
||||
|
Loading…
Reference in New Issue
Block a user