diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-02 14:47:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-03 23:14:04 +0200 |
commit | 53e0d5d7247548743e13c59c35e59fc2161e9582 (patch) | |
tree | 4d841bc6c4ad55512187312f0b63b4393bd976eb /libavformat/options.c | |
parent | 08213e0b7974b7e75d9031d6e448be49a494c0a1 (diff) | |
download | ffmpeg-53e0d5d7247548743e13c59c35e59fc2161e9582.tar.gz |
avformat/options: log filename on open
The loglevel is choosen so that the main filename and any images of
multi image sequences are shown only at debug level to avoid
clutter.
This makes exploits in playlists more visible. As they would show
accesses to private/sensitive files
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/options.c')
-rw-r--r-- | libavformat/options.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/options.c b/libavformat/options.c index 25a506eef8..9371c72667 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -102,6 +102,18 @@ static const AVClass av_format_context_class = { static int io_open_default(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options) { + int loglevel; + + if (!strcmp(url, s->filename) || + s->iformat && !strcmp(s->iformat->name, "image2") || + s->oformat && !strcmp(s->oformat->name, "image2") + ) { + loglevel = AV_LOG_DEBUG; + } else + loglevel = AV_LOG_INFO; + + av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading"); + #if FF_API_OLD_OPEN_CALLBACKS FF_DISABLE_DEPRECATION_WARNINGS if (s->open_cb) |