Commit a5db8e4a authored by Anton Khirnov's avatar Anton Khirnov

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
parent fbc57405
...@@ -557,7 +557,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma ...@@ -557,7 +557,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
} }
s->duration = s->start_time = AV_NOPTS_VALUE; 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 */ /* allocate private data */
if (s->iformat->priv_data_size > 0) { if (s->iformat->priv_data_size > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment