[FFmpeg-cvslog] wv: make probing more robust
Paul B Mahol
git at videolan.org
Wed May 15 12:51:52 CEST 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 14 21:03:09 2013 +0000| [fa23f94eaca3bbbd2f2b7b6e42a52077be59b77e] | committer: Paul B Mahol
wv: make probing more robust
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa23f94eaca3bbbd2f2b7b6e42a52077be59b77e
---
libavformat/wv.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 97a6c1f..ad6e8ac 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;
More information about the ffmpeg-cvslog
mailing list