aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-21 21:18:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-21 21:24:28 +0200
commitb9b3b7663dffb83e112b5a4aaf786fcab23182fa (patch)
tree68eba521952284614e3725fc524ea3cc136ea714
parente942ed9b277cd8058e9ab1b5a762ee399f5231f0 (diff)
Fix: zstd: actually set the compression level from the options
In the zstd compressor, the compression level from the configuration structure wasn't used at all. Instead, the zstd compressor was told to use level 0 and compressor options with that parameter were written to disk. This commit makes sure the level parameter is propperly initialized. Reported-by: Sébastien Gross Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/sqfs/comp/zstd.c1
-rw-r--r--tests/corpus/cantrbry.sha51236
2 files changed, 19 insertions, 18 deletions
diff --git a/lib/sqfs/comp/zstd.c b/lib/sqfs/comp/zstd.c
index 986c669..18289fe 100644
--- a/lib/sqfs/comp/zstd.c
+++ b/lib/sqfs/comp/zstd.c
@@ -154,6 +154,7 @@ int zstd_compressor_create(const sqfs_compressor_config_t *cfg,
return SQFS_ERROR_ALLOC;
zstd->block_size = cfg->block_size;
+ zstd->level = cfg->opt.zstd.level;
zstd->zctx = ZSTD_createCCtx();
if (zstd->zctx == NULL) {
free(zstd);
diff --git a/tests/corpus/cantrbry.sha512 b/tests/corpus/cantrbry.sha512
index f6a269e..6392967 100644
--- a/tests/corpus/cantrbry.sha512
+++ b/tests/corpus/cantrbry.sha512
@@ -88,21 +88,21 @@ c56a091c10941302579793f1285c1a364eb1d7e1efa47957a662923cde51fb7dff2ec8f4e7c61901
be6e91790ce042762402ee2037bb2c1ecb6bbba61a11aca709762b798b4f20d37fb68c005908af95754d04c61891e1b86e7eee94ba18afc7f51e977eece24271 cantrbry_xz_64k_1_T.sqfs
753fe1b202d7f864636bead088b4b52a5f096942603ef0efd1f253b74fc9bdd6a60039daf7ec150ff25ae02bfbf0582d1197eaa2acf91a63fe9a76df44ee54e2 cantrbry_xz_8k_1.sqfs
798f4550280ef87b8a7e485eb6a6a26c2a2d848c530f91e23c33381cd19b3793b073f9c815f9f76354733a4d08fec7427db185e6d35f18ce8a92f9b56ed3ace8 cantrbry_xz_8k_1_T.sqfs
-be56f220ebcfea7df6a86eb447e75dcdb5b9fb0216e8c98aa8bde3564298e7d2060850ef222e9e969ade12a54ca29925fdf7c9f4be981a2cdd72a7e517edf5df cantrbry_zstd_128k_1.sqfs
-24b6ab9f0d7fecad6745f4081d7c9b4956f6e6367c54c38449d0d9040f966f574c97f3586c20c9aa92f906d2ad34c453e4cc721baee8dbc2f54a488ed055db61 cantrbry_zstd_128k_1_T.sqfs
-592e8bb2782823705c4255365214164d2517cfe356e97e0b020bbf1ac26734eedb8d86d840be621fdb3569e97574769a62121f857b2fe5b92e787662a7f50b9e cantrbry_zstd_16k_1.sqfs
-8efade1ba6bca5c2c96fa58dd14e8f70ef156b7d68f767956d9756ce6b164f5869091bb5bfd507a8ca22cec108bb77b201264544baceab71b3b55ffe1e2fbfa3 cantrbry_zstd_16k_1_T.sqfs
-fd5ff31b329c8582d1caa4bd0d084a5983c16ccdd8da1399775eb4832c77df401c3750a00183600ba4d643e9e76da40edfb653d96fc084984074467e0d60bfe4 cantrbry_zstd_1M_1.sqfs
-fd5ff31b329c8582d1caa4bd0d084a5983c16ccdd8da1399775eb4832c77df401c3750a00183600ba4d643e9e76da40edfb653d96fc084984074467e0d60bfe4 cantrbry_zstd_1M_1_T.sqfs
-46d2438c0c80bb8049519ed36679301d9462a01b14ee88eed81e0bb150b0620947b248e7aa75ba31784ebb20b57f50c835b584c1512cd6b4e839fe74c39a8928 cantrbry_zstd_256k_1.sqfs
-64b4f65b551bf5c63675d7510062c39fcb3437c8439371b611d7fbdb826f3c75a17aa54e034d207320802c13fa516ae38fc6e479323eac393378599eb1c5f410 cantrbry_zstd_256k_1_T.sqfs
-47696ce9048eab3a2e515e2461b08649988e5e533193d9c4c51aa98ae32c0311c5ca1bbf9de6604b4e3d41b4f56d9d184a5d5b2ee1281b81f4f24d064d1722c4 cantrbry_zstd_32k_1.sqfs
-18f3c859ad92b8baa25bd0f7d7ee10f0e7bfa6a2e01e2907c4e89d00fe4939298de2dc891318a30ca64ab57e12029290a1b84c3c3a2263a139113a20726b79a0 cantrbry_zstd_32k_1_T.sqfs
-1c1574d2052a64f7fc162530eb6c9a92824db7ae56f77be12a1c101a862f3026d68508a2a94a4f50d407eabeed597585ea1984de24fa859893e8c33685030a87 cantrbry_zstd_4k_1.sqfs
-561af0a65c340a5963bce4ff77a47b7a3752457e688b1e4127d767bfd5f9541a94b810eb337a18deded1a591da8d8f87b15e38c9e6a60438c6c10d61399716f9 cantrbry_zstd_4k_1_T.sqfs
-6361d502c88d1bb2adfbae50914473fd7213e33a3432cbba455096473692e75d9ba6daf4331aa1798a5b4d39a2820ff913d23d48b76991bd5a40e333c21ba355 cantrbry_zstd_512k_1.sqfs
-3e5d2a89946840cf92691eec79ce26d927d9b989b0d789ad3f33bb33471f0c6ae8a28e13b2cdc397bdeb87a4650a78eef0f85140792e24cca6e84966fa760370 cantrbry_zstd_512k_1_T.sqfs
-da1e7e1db1fee70451bfa10204dcfb396f828f78296407297dfed63aac65d80003651616e0265db743e1b1ed4acd72ff856811b023856339502dd6d9d464a9df cantrbry_zstd_64k_1.sqfs
-570149b07fe6db48b0219dc3ab1c5515be5ca448cd1c4f9538f69d02ef9b639efe3249171188bdbbf99c1bfd2d810622586b1ee124f0eafe4521bb542139581b cantrbry_zstd_64k_1_T.sqfs
-86d8030971c0936fcc57d74e20ef48aa032b32c6fa17bbdaa5dcd2008241e506c3cc7027529f35b7c2694dc317814bdfe9c856a60cfce98fc1d41dd634725814 cantrbry_zstd_8k_1.sqfs
-231d0f65d0419aeda41551b787571464d9798798513819d52eeebc3720d69e356e076d81fffd5f00292b799afd6dd408e302142da46c3ef0d6b65026f6163d8b cantrbry_zstd_8k_1_T.sqfs
+42fb77a962cabc965901962585ad9e4a71db2126c0b00f58ece9622445292d1b5b44e4ac7d75ee992a9c44e80b26e1796f61daf6659a4281f120c8014f86dfa6 cantrbry_zstd_128k_1.sqfs
+317c49b36d22505278affef992ef43ccf8b7b7bb0ceeff2520c4377effdf3b8b107bcecee53a8b056f9896f57da43e1f53d4ff66d5d93e4fa550b74a3ed00125 cantrbry_zstd_128k_1_T.sqfs
+3121cd6ede51ecdbabfc18e28c5c00e7b8fc2a9854676e8b4d450a458d28cf5554497c1ba34548a4ef3741d1949f40bb650d54e389bd00509c8d4d4056f5bde8 cantrbry_zstd_16k_1.sqfs
+1e30c3d3ba593585d460936578c8378ab97d0e7b89f6a026136714403187d23f24cce4f3e43fc0c0f961d5781629d1acdb760ac34d2e3ecbfc37738c70a85b2e cantrbry_zstd_16k_1_T.sqfs
+555a0bf90b982de4e10d283b9ee9b4a40ec01589402c93e6f10897789603f30d70c26fc64a38f86d5531278f867ab69a12f3866cdf319fe06a5466b24fbcdb7a cantrbry_zstd_1M_1.sqfs
+555a0bf90b982de4e10d283b9ee9b4a40ec01589402c93e6f10897789603f30d70c26fc64a38f86d5531278f867ab69a12f3866cdf319fe06a5466b24fbcdb7a cantrbry_zstd_1M_1_T.sqfs
+0b4933ed218ddb4a971e296ed60b531f9cadd47bc498df17897c8324255a9e76644bd9eeb85ea33ce27633fd291597d501f8a13f212d31399e851e9c04255e4f cantrbry_zstd_256k_1.sqfs
+152ebb1de2c2f8ef401adfc12e7d2f2c332267a9e2cc5e68205342576740c334d2e293600200b1f1981ae69f94adb1b3efa8bc40255336c49cae34a292494ab1 cantrbry_zstd_256k_1_T.sqfs
+88a3322e6506e870891588018174ecfe6d58d2d01bf9b651a0ffe653c4b1471d28d6f6496b93cecbe68c01b0807901266ffea8e904c44a10c5dcd02380279007 cantrbry_zstd_32k_1.sqfs
+df7bb7fa2854426905fde10613fdd20080e654c9eb333f7dbcd060d088ce817dae22a76827639bc1c010ebdf737decf166e7ca83ef11462d6ba0f4c512022c25 cantrbry_zstd_32k_1_T.sqfs
+c86d43b979a853fd5ef7c15cb2b5d45233a9dbb79a8d7a023d2a9c23dbe9b6da9f366b7f7a5792b2c2545e2dc2450c30e2618cf78e07da9a44c825c1e9a55e46 cantrbry_zstd_4k_1.sqfs
+812059331407c634110f0e29162858c8c3e10b52516fd8434f49592d0f10334126bfa01273a00a842b4b8b7b0d6135c261a39195d9923cdd57ea6c6aec46a431 cantrbry_zstd_4k_1_T.sqfs
+a5f2ee09b35f79aff3e54c445f9884220f9eced6c7753cbf8b2431cda95e7ee6734ca03871ea095bf93c1fe34980381da9b10af6252da1b141f6ee74e2cac4df cantrbry_zstd_512k_1.sqfs
+690ba43837bc340dea1c721ee16f96886071e4219c1ff10172ce7339051aa75d06a8cf5169fac9417be04202d1df5c8de0d78b69d96d694f5142d32d99ef6a47 cantrbry_zstd_512k_1_T.sqfs
+4a2f755a1592ad8c527910203a09f28153174c619657e685fe83994d0c2ca0b2b57e52b86340ae22a997b02d55376cb95568075118ba1bf0db5644cc98bc719e cantrbry_zstd_64k_1.sqfs
+c7fbd8b7a897ee9809873e89f185572c19d981a983d3052513359f1b20c1bf4173eefa1ce07e4b9f2b7753cb99b85c1cc89d20284a48b2fa2acfb11856b40afc cantrbry_zstd_64k_1_T.sqfs
+aa50da06fcea41df756f848fe8e58258d0302866264ed405e3024d8d8af5562dc498801edca0af0b249a30bf83dcc445534096fbf815841c345b54099597a204 cantrbry_zstd_8k_1.sqfs
+e401db837f0b3c70a5670f19fb2f194db6b963a2a45509d71e948b8743e0ea95ae40ac6148abe12b87be2447636554b38f4b6f990d7ba50fc6f89a065222681b cantrbry_zstd_8k_1_T.sqfs