[FFmpeg-devel] [PATCH 2/3] avformat/imfdec: fail on probing non xml file extension

Michael Niedermayer michael at niedermayer.cc
Sat May 6 16:25:02 EEST 2023


Its unexpected that a .avi or other "standard" file turns into a playlist.
The goal of this patch is to avoid this unexpected behavior and possible
privacy or security differences.

This is similar to the same change to hls

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/imfdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 7d04d0d853..eafe9a6a26 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -926,6 +926,11 @@ static int imf_probe(const AVProbeData *p)
     if (!strstr(p->buf, "ContentTitle>"))
         return 0;
 
+    if (!av_match_ext(p->filename, "xml")) {
+        av_log(NULL, AV_LOG_ERROR, "Not detecting imf with non standard extension\n");
+        return 0;
+    }
+
     return AVPROBE_SCORE_MAX;
 }
 
-- 
2.17.1



More information about the ffmpeg-devel mailing list