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

Previously too little data could lead to a false detection.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-19 21:43:15 +02:00
parent 2a976debc1
commit 2a70d8304d
1 changed files with 2 additions and 2 deletions

View File

@ -52,8 +52,8 @@ typedef struct {
static int read_probe(AVProbeData *pd)
{
if (pd->buf[0] == 'J' && pd->buf[1] == 'V' &&
!memcmp(pd->buf + 4, MAGIC, FFMIN(strlen(MAGIC), pd->buf_size - 4)))
if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) <= pd->buf_size - 4 &&
!memcmp(pd->buf + 4, MAGIC, strlen(MAGIC)))
return AVPROBE_SCORE_MAX;
return 0;
}