[FFmpeg-devel] [PATCH] avformat/img2dec: Fix detection of non escaped glob patterns (-pattern_type glob)

Michael Niedermayer michaelni at gmx.at
Sun Oct 5 02:20:12 CEST 2014


Fixes Ticket3948

Based on patch by Alexander Strasser
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/img2dec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 7b3ba49..8822ac2 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -162,6 +162,9 @@ static int img_read_probe(AVProbeData *p)
             return AVPROBE_SCORE_MAX;
         else if (is_glob(p->filename))
             return AVPROBE_SCORE_MAX;
+        // glob pattern? ideally we should check for -pattern_type glob, but we do not have access to that
+        else if (p->filename[strcspn(p->filename, "*?{\0")])
+            return AVPROBE_SCORE_EXTENSION + 2; // score choosen so as to be a hair above the image pipes
         else if (p->buf_size == 0)
             return 0;
         else if (av_match_ext(p->filename, "raw") || av_match_ext(p->filename, "gif"))
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list