diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index e926549a60..b38a4b5e5d 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -130,7 +130,7 @@ static int mjpeg_probe(AVProbeData *p) int nb_invalid = 0; int nb_frames = 0; - for (i=0; ibuf_size-2; i++) { + for (i = 0; i < p->buf_size - 1; i++) { int c; if (p->buf[i] != 0xFF) continue;