Commit fa23f94e authored by Paul B Mahol's avatar Paul B Mahol

wv: make probing more robust

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent a9cadacd
...@@ -73,8 +73,11 @@ static int wv_probe(AVProbeData *p) ...@@ -73,8 +73,11 @@ static int wv_probe(AVProbeData *p)
/* check file header */ /* check file header */
if (p->buf_size <= 32) if (p->buf_size <= 32)
return 0; return 0;
if (p->buf[0] == 'w' && p->buf[1] == 'v' && if (AV_RL32(&p->buf[0]) == MKTAG('w', 'v', 'p', 'k') &&
p->buf[2] == 'p' && p->buf[3] == 'k') AV_RL32(&p->buf[4]) >= 24 &&
AV_RL32(&p->buf[4]) <= WV_BLOCK_LIMIT &&
AV_RL16(&p->buf[8]) >= 0x402 &&
AV_RL16(&p->buf[8]) <= 0x410)
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
else else
return 0; return 0;
......
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