From ad97483b6e55142fd8d5c041db057017a891cd95 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 27 Sep 2008 23:37:13 +0300 Subject: [PATCH] Changed magic bytes to match the updated spec. Filename suffix wasn't changed yet. --- src/liblzma/common/auto_decoder.c | 4 ++-- src/liblzma/common/stream_flags_common.c | 2 +- tests/files/bad-0-backward_size.lzma | Bin 32 -> 32 bytes tests/files/bad-0-empty-truncated.lzma | Bin 31 -> 31 bytes tests/files/bad-0-nonempty_index.lzma | Bin 32 -> 32 bytes tests/files/bad-0cat-alone.lzma | Bin 55 -> 55 bytes tests/files/bad-0catpad-empty.lzma | Bin 69 -> 69 bytes tests/files/bad-0pad-empty.lzma | Bin 37 -> 37 bytes tests/files/bad-1-block_header-1.lzma | Bin 64 -> 64 bytes tests/files/bad-1-block_header-2.lzma | Bin 64 -> 64 bytes tests/files/bad-1-block_header-3.lzma | Bin 68 -> 68 bytes tests/files/bad-1-block_header-4.lzma | Bin 72 -> 72 bytes tests/files/bad-1-check-crc32.lzma | Bin 68 -> 68 bytes tests/files/bad-1-check-crc64.lzma | Bin 72 -> 72 bytes tests/files/bad-1-check-sha256.lzma | Bin 96 -> 96 bytes tests/files/bad-1-lzma2-1.lzma | Bin 64 -> 64 bytes tests/files/bad-1-lzma2-2.lzma | Bin 424 -> 424 bytes tests/files/bad-1-lzma2-3.lzma | Bin 424 -> 424 bytes tests/files/bad-1-lzma2-4.lzma | Bin 408 -> 408 bytes tests/files/bad-1-lzma2-5.lzma | Bin 408 -> 408 bytes tests/files/bad-1-lzma2-6.lzma | Bin 68 -> 68 bytes tests/files/bad-1-lzma2-7.lzma | Bin 408 -> 408 bytes tests/files/bad-1-stream_flags-1.lzma | Bin 68 -> 68 bytes tests/files/bad-1-stream_flags-2.lzma | Bin 68 -> 68 bytes tests/files/bad-1-stream_flags-3.lzma | Bin 68 -> 68 bytes tests/files/bad-1-vli-1.lzma | Bin 72 -> 72 bytes tests/files/bad-1-vli-2.lzma | Bin 72 -> 72 bytes .../files/bad-2-compressed_data_padding.lzma | Bin 92 -> 92 bytes tests/files/bad-2-index-1.lzma | Bin 92 -> 92 bytes tests/files/bad-2-index-2.lzma | Bin 92 -> 92 bytes tests/files/bad-2-index-3.lzma | Bin 92 -> 92 bytes tests/files/bad-2-index-4.lzma | Bin 92 -> 92 bytes tests/files/good-0-empty.lzma | Bin 32 -> 32 bytes tests/files/good-0cat-empty.lzma | Bin 64 -> 64 bytes tests/files/good-0catpad-empty.lzma | Bin 68 -> 68 bytes tests/files/good-0pad-empty.lzma | Bin 36 -> 36 bytes tests/files/good-1-3delta-lzma2.lzma | Bin 528 -> 528 bytes tests/files/good-1-block_header-1.lzma | Bin 72 -> 72 bytes tests/files/good-1-block_header-2.lzma | Bin 68 -> 68 bytes tests/files/good-1-block_header-3.lzma | Bin 68 -> 68 bytes tests/files/good-1-check-crc32.lzma | Bin 68 -> 68 bytes tests/files/good-1-check-crc64.lzma | Bin 72 -> 72 bytes tests/files/good-1-check-none.lzma | Bin 64 -> 64 bytes tests/files/good-1-check-sha256.lzma | Bin 96 -> 96 bytes tests/files/good-1-delta-lzma2.tiff.lzma | Bin 51312 -> 51312 bytes tests/files/good-1-lzma2-1.lzma | Bin 424 -> 424 bytes tests/files/good-1-lzma2-2.lzma | Bin 424 -> 424 bytes tests/files/good-1-lzma2-3.lzma | Bin 408 -> 408 bytes tests/files/good-1-sparc-lzma2.lzma | Bin 2292 -> 2292 bytes tests/files/good-1-x86-lzma2.lzma | Bin 1936 -> 1936 bytes tests/files/good-2-lzma2.lzma | Bin 92 -> 92 bytes tests/files/unsupported-block_header.lzma | Bin 68 -> 68 bytes tests/files/unsupported-check.lzma | Bin 68 -> 68 bytes tests/files/unsupported-filter_flags-1.lzma | Bin 68 -> 68 bytes tests/files/unsupported-filter_flags-2.lzma | Bin 68 -> 68 bytes tests/files/unsupported-filter_flags-3.lzma | Bin 68 -> 68 bytes 56 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/liblzma/common/auto_decoder.c b/src/liblzma/common/auto_decoder.c index 05a9fbb4..dd108324 100644 --- a/src/liblzma/common/auto_decoder.c +++ b/src/liblzma/common/auto_decoder.c @@ -52,10 +52,10 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator, coder->sequence = SEQ_CODE; // Detect the file format. For now this is simple, since if - // it doesn't start with 0xFF (the first magic byte of the + // it doesn't start with 0xFD (the first magic byte of the // new format), it has to be LZMA_Alone, or something that // we don't support at all. - if (in[*in_pos] == 0xFF) { + if (in[*in_pos] == 0xFD) { return_if_error(lzma_stream_decoder_init( &coder->next, allocator, coder->memlimit, coder->flags)); diff --git a/src/liblzma/common/stream_flags_common.c b/src/liblzma/common/stream_flags_common.c index 1f7220ec..ae587717 100644 --- a/src/liblzma/common/stream_flags_common.c +++ b/src/liblzma/common/stream_flags_common.c @@ -20,7 +20,7 @@ #include "stream_flags_common.h" -const uint8_t lzma_header_magic[6] = { 0xFF, 0x4C, 0x5A, 0x4D, 0x41, 0x00 }; +const uint8_t lzma_header_magic[6] = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 }; const uint8_t lzma_footer_magic[2] = { 0x59, 0x5A }; diff --git a/tests/files/bad-0-backward_size.lzma b/tests/files/bad-0-backward_size.lzma index 07c4695af5bb815198ebbf597349bafa6cb51655..2b46fa937b3e6e770f12973398f01d124f9220f4 100644 GIT binary patch literal 32 kcmexsUKJ6=z`&TPbkB?d2xRWND4I?@dJM#7V2q3c0GX-?W&i*H literal 32 kcmezG6Xom3z`&TPbkB?d2xRWND4I?@dJM#7V2q3c0F=52IRF3v diff --git a/tests/files/bad-0-empty-truncated.lzma b/tests/files/bad-0-empty-truncated.lzma index 15b6fe3650a9344012bb507022b72418ae40b3dc..f879af84ac473517a186f80510091273d9ea9676 100644 GIT binary patch literal 31 jcmexsUKJ6=z`&TPbkB?d2xRWNC{A#i$;$}hFh&9ZipmEx literal 31 jcmezG6Xom3z`&TPbkB?d2xRWNC{A#i$;$}hFh&9Zh6e`+ diff --git a/tests/files/bad-0-nonempty_index.lzma b/tests/files/bad-0-nonempty_index.lzma index 2a612c61904a12fa93fc591710ca7c78260a5909..ed6e81fa0465f28bd06c400814c08d88e28d16b6 100644 GIT binary patch literal 32 lcmexsUKJ6=z`&TPbkB@|k%2*bYn#FZrql6%jR&)d&C<4+ES4 delta 11 ScmXpvXZ`OJDW&LYj6%jR2OM0RLE1V4gUcv{r delta 23 XcmZ>DW&Q6H diff --git a/tests/files/bad-0pad-empty.lzma b/tests/files/bad-0pad-empty.lzma index c5b985c012f6f6b1f52d2d695a3a867379b3196e..45e00b74a3ffbdfc4738b5aea9c52093bca54fe3 100644 GIT binary patch delta 11 ScmY#YW&LYj6%jR&RRI7Lg9By& delta 11 ScmY#YW&Q6H8VEt=e6%jR&)fxa6)dRNx delta 11 ScmZ>8VEykC8VEt=e6%jR&)fxa6)dRNx delta 11 ScmZ>8VEykC9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD$wU diff --git a/tests/files/bad-1-check-crc32.lzma b/tests/files/bad-1-check-crc32.lzma index b82b6591c87d2db5c0d3d9b7b1b915a038111c46..f8ec7d61eab64001ed756f9f11837d125938a22e 100644 GIT binary patch delta 11 ScmZ>9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD$wU diff --git a/tests/files/bad-1-check-sha256.lzma b/tests/files/bad-1-check-sha256.lzma index e47609cdfc1ba610dd2d36041c0058560e6590bf..e33cee80dee5b8228d1474deae6ac35da4731350 100644 GIT binary patch delta 11 ScmYdDVEt=e6%jR&H5vdJl>`?6 delta 11 ScmYdDVEykC_X diff --git a/tests/files/bad-1-lzma2-1.lzma b/tests/files/bad-1-lzma2-1.lzma index 0296e5ff76bb69e1a6b9eb915200a181a5367173..f7ff6dd39234e39d92dd3daef6746066f2e34fd4 100644 GIT binary patch delta 11 ScmZ>8VEt=e6%jR&)fxa6)dRNx delta 11 ScmZ>8VEykCnauX$BO)JE3Di~uKh1r`7R delta 14 VcmZ3%yn>nazfY8}<3`rSi~uH*1nB?( diff --git a/tests/files/bad-1-lzma2-3.lzma b/tests/files/bad-1-lzma2-3.lzma index fbe3297fd5b469d3a15ed68e9820a28ab94b26fd..e1a2083197a55352139e78b1795c1c202a38493c 100644 GIT binary patch delta 14 VcmZ3%yn>nauX$BO)JE3Di~uKh1r`7R delta 14 VcmZ3%yn>nazfY8}<3`rSi~uH*1nB?( diff --git a/tests/files/bad-1-lzma2-4.lzma b/tests/files/bad-1-lzma2-4.lzma index ef0dc491d8ae856fbfddb300f53003fda15fbe3b..e0eb7aaade0dcbc7a4d4dbb2995567688ee181b7 100644 GIT binary patch delta 14 VcmbQiJcF6_uX$BO)JE3Hi~uFK1m*w$ delta 14 VcmbQiJcF6_zfY8}<3`rWi~uCk1i1hJ diff --git a/tests/files/bad-1-lzma2-5.lzma b/tests/files/bad-1-lzma2-5.lzma index 797b7d35fed6086542ce9ff3453eec786b2d8e77..437aeed077ccd1bf178a2a7c86a439eabb93558d 100644 GIT binary patch delta 14 VcmbQiJcF6_uX$BO)JE3Hi~uFK1m*w$ delta 14 VcmbQiJcF6_zfY8}<3`rWi~uCk1i1hJ diff --git a/tests/files/bad-1-lzma2-6.lzma b/tests/files/bad-1-lzma2-6.lzma index 73db5bff6b283b43d0a2e7d1dcbbe8de4f737807..f87cab68724f0c93bda2976428e798b7fd528d09 100644 GIT binary patch delta 11 ScmZ>9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD$wU diff --git a/tests/files/bad-1-vli-2.lzma b/tests/files/bad-1-vli-2.lzma index af2b614b4b19d8164e72d4b55e176a614c6f0362..604e818616ae30a4fb1b2520a764a253669a555f 100644 GIT binary patch delta 11 Scmeb9VEt=e6%jR&)foU6g#*t3 delta 11 Scmeb9VEykC$wU diff --git a/tests/files/bad-2-compressed_data_padding.lzma b/tests/files/bad-2-compressed_data_padding.lzma index c9de47480546aedf48be863c8eb887270140cc20..1d0f58b78b52c0161993324f63ef54f4b9062c43 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/bad-2-index-1.lzma b/tests/files/bad-2-index-1.lzma index cc6ba6dd2bf82d7d5837394c2ba7f1dc99a93dfd..42efda0d34d87f9dc93cad2b3d267846514e0888 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/bad-2-index-2.lzma b/tests/files/bad-2-index-2.lzma index 8ce40b63526a4d96525e00e421e3eff9a30e622e..ee5e89c2a59a49484ab0133327e3b6c7674b2deb 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/bad-2-index-3.lzma b/tests/files/bad-2-index-3.lzma index de27f55f1a12bb79087c19370aef0dea5f415a51..f51eaad8f1a470337521683c53db85a30330dfd8 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/bad-2-index-4.lzma b/tests/files/bad-2-index-4.lzma index 0a273477f084e7228b6321108c34b08eaf881238..1b5b78e48e58c4f2bd2a2f9bae0f61ccfcc769a4 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/good-0-empty.lzma b/tests/files/good-0-empty.lzma index 3256fe1568d3242943e33dfbb32708d6f42d3477..83b95e05bc814cb60f759a30e89d243960797b60 100644 GIT binary patch literal 32 kcmexsUKJ6=z`&TPbkB?d2xRWNC{A#i$;$}hFh)iJ0Fqb-jsO4v literal 32 kcmezG6Xom3z`&TPbkB?d2xRWNC{A#i$;$}hFh)iJ0F7t|VE_OC diff --git a/tests/files/good-0cat-empty.lzma b/tests/files/good-0cat-empty.lzma index ef8e106a49fce4ee98a579b15c66e142fcd85fa6..e6fc31461db459ae9075e704581317d910b4afee 100644 GIT binary patch literal 64 ncmexsUKJ6=z`&TPbkB?d2xRWNC{A#i$;$}hFh)lGB_Iy~7H$t4 literal 64 ncmezG6Xom3z`&TPbkB?d2xRWNC{A#i$;$}hFh)lGCm;_12JQ~Q diff --git a/tests/files/good-0catpad-empty.lzma b/tests/files/good-0catpad-empty.lzma index 7e5a81d4c96d06b1a9f8159f2b1c24da08a79f70..4f86b7d152d477b0da914aff1590000e89bf1183 100644 GIT binary patch delta 23 XcmZ>9Vf|}f6%jR2Q+lET3!DuAUV8_! literal 68 pcmezG6Xom3z`&TPbkB?d2xRWNC{A#i$;$}hFh)j!sQ(1i001O%4#5Bb diff --git a/tests/files/good-0pad-empty.lzma b/tests/files/good-0pad-empty.lzma index 3bbc241b66d4b6c40341b3b54d3cb6d69a8b1c22..c51e3a69c0de7e68ad78338a6c86cb2980eb1a2f 100644 GIT binary patch delta 11 ScmY#UVf|}f6%jR&RUQBoZ3ANf delta 11 ScmY#UVg2tD$wU diff --git a/tests/files/good-1-block_header-2.lzma b/tests/files/good-1-block_header-2.lzma index 7afa25fa3454142a629369b84f0f34e0602da5eb..5eb8575ce7eaa721c4708a84a0472fe1c1e1eacf 100644 GIT binary patch delta 11 ScmZ>9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD$wU diff --git a/tests/files/good-1-check-none.lzma b/tests/files/good-1-check-none.lzma index 7b7ccd5f98e0468b72c05cfdb227e4009243bd11..aab057d7c536efd01af8c3edf550fb06a37e7f43 100644 GIT binary patch delta 11 ScmZ>8VEt=e6%jR&)fxa6)dRNx delta 11 ScmZ>8VEykC`?6 delta 11 ScmYdDVEykC_X diff --git a/tests/files/good-1-delta-lzma2.tiff.lzma b/tests/files/good-1-delta-lzma2.tiff.lzma index d52b70d436aa11c7b67a6dcc4479b2fb2cbe82cb..744fb8d189e29f0230d1cf72e89d6ffc4bd042a0 100644 GIT binary patch delta 16 Ycmew`f%(G(X4b#vRS{7eS+h?706`-MRR910 delta 16 Ycmew`f%(G(X4d~cQNE5FS+h?706;zmC;$Ke diff --git a/tests/files/good-1-lzma2-1.lzma b/tests/files/good-1-lzma2-1.lzma index 386a1c159473e1a8dd3cb04beafd74941995287d..96aff26e1f5b002639c164f671e1bf6032ea9cfc 100644 GIT binary patch delta 14 VcmZ3%yn>nauX$BO)JE3Di~uKh1r`7R delta 14 VcmZ3%yn>nazfY8}<3`rSi~uH*1nB?( diff --git a/tests/files/good-1-lzma2-2.lzma b/tests/files/good-1-lzma2-2.lzma index 2397a8492281da2141f79f37e01a1a0847531757..19631d483d9c0e67c8463b8c10ab119b12661f33 100644 GIT binary patch delta 14 VcmZ3%yn>nauX$BO)JE3Di~uKh1r`7R delta 14 VcmZ3%yn>nazfY8}<3`rSi~uH*1nB?( diff --git a/tests/files/good-1-lzma2-3.lzma b/tests/files/good-1-lzma2-3.lzma index 096f65c1abc1f73c902ff3519d03a83805c41e96..11c84ee6a7d97ba49c05f2a71bffe175a6ff087b 100644 GIT binary patch delta 14 VcmbQiJcF6_uX$BO)JE3Hi~uFK1m*w$ delta 14 VcmbQiJcF6_zfY8}<3`rWi~uCk1i1hJ diff --git a/tests/files/good-1-sparc-lzma2.lzma b/tests/files/good-1-sparc-lzma2.lzma index bfc7ac0b4a5aa9842e3dc39f47fe6c193202dcbb..9111e39be22ed7128d8e067b97750effc4152d24 100644 GIT binary patch delta 14 Vcmew&_(hQQuX$BO)JE3#8~`yM1|0wZ delta 14 Vcmew&_(hQQzfY8}<3`r^8~`vm1@Hg> diff --git a/tests/files/good-1-x86-lzma2.lzma b/tests/files/good-1-x86-lzma2.lzma index 62fb01a29694ea17cea251eee48cc23e1f79ebf3..4fbd0ee40685f524a30e68a4d7a96428f727779a 100644 GIT binary patch delta 14 VcmbQhKY^e1uX$BO)JE2Bb^s;)1nd9+ delta 14 VcmbQhKY^e1zfY8}<3`qQb^s+91it_P diff --git a/tests/files/good-2-lzma2.lzma b/tests/files/good-2-lzma2.lzma index 49165309bee155e248b2ec8a543828f53c12a4a6..dd34b66a4f5bead8bcbb88ee98b5e36d889c0679 100644 GIT binary patch delta 11 Scma!vVf|}f6%jR&H5>pLJp>B? delta 11 Scma!vVg2tDpKg#+FI diff --git a/tests/files/unsupported-block_header.lzma b/tests/files/unsupported-block_header.lzma index 2fa33a5bbf9bc0af2ee57a6585a006b44db82e69..ee697e4d7c5a0bed975944bef1deb6f911643628 100644 GIT binary patch delta 11 ScmZ>9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD9Vf|}f6%jR&)gAyBEd#>< delta 11 ScmZ>9Vg2tD