Hi!

Attached patch fixes ticket #9026.

Please comment, Carl Eugen
From 0acdf4ccbad59d10d1b8fa2a1bde0b7cf59a46ab Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Wed, 9 Dec 2020 23:35:36 +0100
Subject: [PATCH] lavf/img2dec: Return a low score for mjpeg when probing
 jpeg_pipe.

Fixes ticket #9026.
---
 libavformat/img2dec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 4f9bfc635a..faa67d0562 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -760,7 +760,11 @@ static int jpeg_probe(const AVProbeData *p)
         c = b[i + 1];
         switch (c) {
         case SOI:
-            return 0;
+            if (state == EOI) {
+                return AVPROBE_SCORE_EXTENSION / 8;
+            } else {
+                return 0;
+            }
         case SOF0:
         case SOF1:
         case SOF2:
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to