Skip to content

Commit 64e30d8

Browse files
committed
demux/mf: guard passing NULL to %s in filelist log
1 parent 6538cc4 commit 64e30d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

demux/demux_mf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename
100100
}
101101

102102
if (strchr(filename, ',')) {
103-
mp_info(log, "filelist: %s\n", filename);
103+
mp_info(log, "filelist: %s\n", filename ? filename : "(null)");
104104
bstr bfilename = bstr0(filename);
105105

106106
while (bfilename.len) {
@@ -191,15 +191,15 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename
191191
if (bad_spec || nspec != 1) {
192192
mp_err(log,
193193
"unsupported expr format: '%s' - exactly one format specifier of the form %%[.][NUM]d is expected\n",
194-
filename);
194+
filename ? filename : "(null)");
195195
goto exit_mf;
196196
}
197197

198-
mp_info(log, "search expr: %s\n", filename);
198+
mp_info(log, "search expr: %s\n", filename ? filename : "(null)");
199199

200200
while (error_count < 5) {
201201
if (snprintf(fname, fname_avail, filename, count++) >= fname_avail) {
202-
mp_err(log, "format result too long: '%s'\n", filename);
202+
mp_err(log, "format result too long: '%s'\n", filename ? filename : "(null)");
203203
goto exit_mf;
204204
}
205205
if (!mp_path_exists(fname)) {

0 commit comments

Comments
 (0)