aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_support_format_7zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_read_support_format_7zip.c')
-rw-r--r--libarchive/archive_read_support_format_7zip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_7zip.c b/libarchive/archive_read_support_format_7zip.c
index 87c6c5272197..6ce9d1a0e1bb 100644
--- a/libarchive/archive_read_support_format_7zip.c
+++ b/libarchive/archive_read_support_format_7zip.c
@@ -1086,10 +1086,17 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
zip->bcj_state = 0;
break;
case _7Z_DELTA:
+ if (coder2->propertiesSize != 1) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Invalid Delta parameter");
+ return (ARCHIVE_FAILED);
+ }
filters[fi].id = LZMA_FILTER_DELTA;
memset(&delta_opt, 0, sizeof(delta_opt));
delta_opt.type = LZMA_DELTA_TYPE_BYTE;
- delta_opt.dist = 1;
+ delta_opt.dist =
+ (uint32_t)coder2->properties[0] + 1;
filters[fi].options = &delta_opt;
fi++;
break;