diff --git a/libavformat/utils.c b/libavformat/utils.c index 57fc836c64..5f3da495fd 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -622,7 +622,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) {