diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-06-15 21:58:11 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-06-16 19:09:33 +0400 |
commit | a5db8e4a1a5449cc7a61e963c9fa698a4f22131b (patch) | |
tree | e9d614a14849eb70f1b4d3869b1e0a47d1304535 /libavformat/utils.c | |
parent | fbc57405664876cb7f47f1ac264db16a3014e665 (diff) |
lavf: don't segfault when a NULL filename is passed to avformat_open_input()
This can easily happen when the caller is using a custom AVIOContext.
Behave as if the filename was an empty string in this case.
CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d7ba5a7405..5450dc4bff 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -557,7 +557,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma } s->duration = s->start_time = AV_NOPTS_VALUE; - av_strlcpy(s->filename, filename, sizeof(s->filename)); + av_strlcpy(s->filename, filename ? filename : "", sizeof(s->filename)); /* allocate private data */ if (s->iformat->priv_data_size > 0) { |