Hi!

Attached patch fixes ticket #6957 for me, I believe
there was an off-by-one issue in the original function.

Please comment, Carl Eugen
From 0711e0474f9a83ec47a31b8cf261cf2e6a10a35e Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Sat, 20 Jan 2018 16:07:25 +0100
Subject: [PATCH] lavf/rawdec: Also probe the last byte of mjpeg streams.

Fixes ticket #6957.
---
 libavformat/rawdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index e926549..b38a4b5 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; i<p->buf_size-2; i++) {
+    for (i = 0; i < p->buf_size - 1; i++) {
         int c;
         if (p->buf[i] != 0xFF)
             continue;
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to