diff options
-rw-r--r-- | stream/stream_libarchive.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index 9d93af5450..50177028ea 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -290,8 +290,8 @@ bool mp_archive_next_entry(struct mp_archive *mpa) // Some archives may have no filenames, or libarchive won't return some. const char *fn = archive_entry_pathname(entry); char buf[64]; - if (!fn) { - snprintf(buf, sizeof(buf), "mpv_unknown#%d\n", mpa->entry_num); + if (!fn || bstr_validate_utf8(bstr0(fn)) < 0) { + snprintf(buf, sizeof(buf), "mpv_unknown#%d", mpa->entry_num); fn = buf; } mpa->entry = entry; |