diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-06-15 19:58:11 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-09-28 08:06:39 +0200 |
commit | 7124fa5d3640e5b8089dd13b22a09038b2ec5216 (patch) | |
tree | 8f1c8d30b0638220bfbecc88a521f195b7f44472 | |
parent | da0c457663479bc1828918e1bb3e4a5e4de0d557 (diff) | |
download | ffmpeg-7124fa5d3640e5b8089dd13b22a09038b2ec5216.tar.gz |
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
(cherry picked from commit a5db8e4a1a5449cc7a61e963c9fa698a4f22131b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-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 0c355cee60..240cd94925 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -634,7 +634,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) { |