aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_support_filter_zstd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_read_support_filter_zstd.c')
-rw-r--r--libarchive/archive_read_support_filter_zstd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/archive_read_support_filter_zstd.c b/libarchive/archive_read_support_filter_zstd.c
index c8bb36be703c..af7eeb7c1e24 100644
--- a/libarchive/archive_read_support_filter_zstd.c
+++ b/libarchive/archive_read_support_filter_zstd.c
@@ -119,6 +119,8 @@ zstd_bidder_bid(struct archive_read_filter_bidder *self,
/* Zstd frame magic values */
const unsigned zstd_magic = 0xFD2FB528U;
+ const unsigned zstd_magic_skippable_start = 0x184D2A50U;
+ const unsigned zstd_magic_skippable_mask = 0xFFFFFFF0;
(void) self; /* UNUSED */
@@ -129,6 +131,8 @@ zstd_bidder_bid(struct archive_read_filter_bidder *self,
prefix = archive_le32dec(buffer);
if (prefix == zstd_magic)
return (32);
+ if ((prefix & zstd_magic_skippable_mask) == zstd_magic_skippable_start)
+ return (32);
return (0);
}