mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
2a976debc1
commit
2a70d8304d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue