]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/jvdec.c
avcodec/h264, videotoolbox: do not return invalid frames on failure
[ffmpeg] / libavformat / jvdec.c
index 4d4f0c78c53db3a365b59ced6d8a28329b1f5d65..a31c7236ff5075ecc74c6bcca16bcc425538590e 100644 (file)
@@ -54,7 +54,7 @@ typedef struct JVDemuxContext {
 
 static int read_probe(AVProbeData *pd)
 {
-    if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) <= pd->buf_size - 4 &&
+    if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) + 4 <= pd->buf_size &&
         !memcmp(pd->buf + 4, MAGIC, strlen(MAGIC)))
         return AVPROBE_SCORE_MAX;
     return 0;