[FFmpeg-devel] [PATCH 1/2] avformat/format: Ensure that there are at least 16kb for probing before stoping due to a extension match

Michael Niedermayer michael at niedermayer.cc
Fri Jul 15 23:41:45 EEST 2016


Fixes probing regression with openmpt
Fixes regression of Ticket 2583

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/format.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/format.c b/libavformat/format.c
index 38ca2a3..94fd23d 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -224,8 +224,12 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
                 }
             }
         } else if (fmt1->extensions) {
-            if (av_match_ext(lpd.filename, fmt1->extensions))
-                score = AVPROBE_SCORE_EXTENSION;
+            if (av_match_ext(lpd.filename, fmt1->extensions)) {
+                if (lpd.buf_size < 16384) {
+                    score = AVPROBE_SCORE_EXTENSION / 2 - 1;
+                } else
+                    score = AVPROBE_SCORE_EXTENSION;
+            }
         }
         if (av_match_name(lpd.mime_type, fmt1->mime_type)) {
             if (AVPROBE_SCORE_MIME > score) {
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list