mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-17 04:17:05 +00:00
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
This commit is contained in:
parent
fbc5740566
commit
a5db8e4a1a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user