提交 9216ad2e 编写于 作者: P Paul B Mahol

avformat/tty: make probing strict for first 8 bytes

上级 5ad1c1a1
......@@ -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) *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册