diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-15 09:16:29 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-15 09:16:29 +0000 |
commit | 97e078087b08cbca22bd1c8f373653e559616b42 (patch) | |
tree | 0d2c14f153f92077834784d22ef9f9480dd0df6c | |
parent | 1ac9563075edd386932ff402c378944cc2da1873 (diff) | |
download | ffmpeg-97e078087b08cbca22bd1c8f373653e559616b42.tar.gz |
Improve sierravmd probe. It is still quite weak, but further improvements
are non-obvious and probably need a large (about 1kB at least) probe buffer.
Originally committed as revision 19850 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/sierravmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 5aa5a04dbb..5660282db2 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -61,10 +61,17 @@ typedef struct VmdDemuxContext { static int vmd_probe(AVProbeData *p) { + int w, h; + if (p->buf_size < 16) + return 0; /* check if the first 2 bytes of the file contain the appropriate size * of a VMD header chunk */ if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2) return 0; + w = AV_RL16(&p->buf[12]); + h = AV_RL16(&p->buf[14]); + if (!w || w > 2048 || !h || h > 2048) + return 0; /* only return half certainty since this check is a bit sketchy */ return AVPROBE_SCORE_MAX / 2; |