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

Pierre-Anthony Lemieux pal at sandflow.com
Sat May 6 21:01:20 EEST 2023


On Sat, May 6, 2023 at 6:25 AM Michael Niedermayer
<michael at niedermayer.cc> wrote:
>
> 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.

Per the IMF specification, a CPL can have any extension or, in fact,
no extension. The latter is routinely used.

>
> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list