Commit 2a70d830 authored by Michael Niedermayer's avatar Michael Niedermayer

jvdec: Make sure there is enough data for the id string.

Previously too little data could lead to a false detection.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2a976deb
...@@ -52,8 +52,8 @@ typedef struct { ...@@ -52,8 +52,8 @@ typedef struct {
static int read_probe(AVProbeData *pd) static int read_probe(AVProbeData *pd)
{ {
if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) <= pd->buf_size - 4 &&
!memcmp(pd->buf + 4, MAGIC, FFMIN(strlen(MAGIC), pd->buf_size - 4))) !memcmp(pd->buf + 4, MAGIC, strlen(MAGIC)))
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
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