aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-08-18 23:26:40 +0200
committerGravatar wm4 <wm4@nowhere>2015-08-18 23:26:40 +0200
commit4427fa9900a33f21ace5f7642fc5bc65a379c8c5 (patch)
tree609ccbcab4302d76b7123d79c92fa87145bf5ee4 /stream
parent594071dbf407830d4a076e062c353f6a8fb2e172 (diff)
stream_libarchive: restrict number of allowed formats
Most of what is not in this list is extremely obscure, or increases the file format misdetection rate.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_libarchive.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c
index 475febc726..6a39f8fac8 100644
--- a/stream/stream_libarchive.c
+++ b/stream/stream_libarchive.c
@@ -79,8 +79,17 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
mpa->arch = archive_read_new();
if (!mpa->arch)
goto err;
- archive_read_support_format_all(mpa->arch);
- archive_read_support_filter_all(mpa->arch);
+
+ archive_read_support_format_7zip(mpa->arch);
+ archive_read_support_format_gnutar(mpa->arch);
+ archive_read_support_format_tar(mpa->arch);
+ archive_read_support_format_iso9660(mpa->arch);
+ archive_read_support_format_rar(mpa->arch);
+ archive_read_support_format_zip(mpa->arch);
+ archive_read_support_filter_bzip2(mpa->arch);
+ archive_read_support_filter_gzip(mpa->arch);
+ archive_read_support_filter_xz(mpa->arch);
+
if (flags & MP_ARCHIVE_FLAG_UNSAFE)
archive_read_support_format_raw(mpa->arch);
archive_read_set_callback_data(mpa->arch, mpa);