Commit 7b9e10c1 authored by reimar's avatar reimar

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19850 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7585b047
...@@ -61,10 +61,17 @@ typedef struct VmdDemuxContext { ...@@ -61,10 +61,17 @@ typedef struct VmdDemuxContext {
static int vmd_probe(AVProbeData *p) 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 /* check if the first 2 bytes of the file contain the appropriate size
* of a VMD header chunk */ * of a VMD header chunk */
if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2) if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
return 0; 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 */ /* only return half certainty since this check is a bit sketchy */
return AVPROBE_SCORE_MAX / 2; return AVPROBE_SCORE_MAX / 2;
......
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