Skip to content

Commit 139591a

Browse files
xyfishsfan5
authored andcommitted
libarchive: try to use utf8 pathname
1 parent 3baf2e1 commit 139591a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stream/stream_libarchive.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ bool mp_archive_next_entry(struct mp_archive *mpa)
429429
// Some archives may have no filenames, or libarchive won't return some.
430430
const char *fn = archive_entry_pathname(entry);
431431
char buf[64];
432+
if (!fn || bstr_validate_utf8(bstr0(fn)) < 0)
433+
fn = archive_entry_pathname_utf8(entry);
432434
if (!fn || bstr_validate_utf8(bstr0(fn)) < 0) {
433435
snprintf(buf, sizeof(buf), "mpv_unknown#%d", mpa->entry_num);
434436
fn = buf;

0 commit comments

Comments
 (0)