summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-19 21:43:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-19 21:43:15 +0200
commit2a70d8304dd2f8e97b9b0d2321ffbf6da69093f1 (patch)
treeb93f20c6d094884b8bc36affdfbb8640f22b21d0
parent2a976debc1de10c22c258583b543ab5b4bbe5974 (diff)
downloadffmpeg-2a70d8304dd2f8e97b9b0d2321ffbf6da69093f1.tar.gz
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>
-rw-r--r--libavformat/jvdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index fbd4f1e5f4..3977594f8b 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -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;
}