]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
7zip: only fall back to 7Z_ZSTD if we can actually use zstd
authorDustin L. Howett <dustin@howett.net>
Mon, 1 Jun 2026 17:38:07 +0000 (13:38 -0400)
committerDustin L. Howett <dustin@howett.net>
Mon, 1 Jun 2026 17:39:57 +0000 (13:39 -0400)
Without this fix, the 7zip writer will fall back to zstd (when it is the
last available option) even if it could not be linked, then fail at
runtime with an unexpected error message.

libarchive/archive_write_set_format_7zip.c

index f3f8610597e7ac89f6cd785556f3d463c641bc82..80d4ba0daf8aecf7c3ae32d999d2ed0dc29c479b 100644 (file)
@@ -379,7 +379,7 @@ archive_write_set_format_7zip(struct archive *_a)
        zip->opt_compression = _7Z_BZIP2;
 #elif defined(HAVE_ZLIB_H)
        zip->opt_compression = _7Z_DEFLATE;
-#elif HAVE_ZSTD_H
+#elif HAVE_ZSTD_H && HAVE_ZSTD_compressStream
        zip->opt_compression = _7Z_ZSTD;
 #else
        zip->opt_compression = _7Z_COPY;