summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-05-14 21:03:09 +0000
committerPaul B Mahol <onemda@gmail.com>2013-05-15 10:51:30 +0000
commitfa23f94eaca3bbbd2f2b7b6e42a52077be59b77e (patch)
treeaa8b488d3cc0980d7dee59fa9b7655d100258d42 /libavformat
parenta9cadacdd982c8a8a008d208455a20a8a19431bc (diff)
wv: make probing more robust
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/wv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 97a6c1f2e8..ad6e8acda9 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -73,8 +73,11 @@ static int wv_probe(AVProbeData *p)
/* check file header */
if (p->buf_size <= 32)
return 0;
- if (p->buf[0] == 'w' && p->buf[1] == 'v' &&
- p->buf[2] == 'p' && p->buf[3] == 'k')
+ if (AV_RL32(&p->buf[0]) == MKTAG('w', 'v', 'p', '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;
else
return 0;