bash-5.0# dd if=/dev/zero bs=1 count=20 | xz -C none -c > zeros.xz
20+0 records in
20+0 records out
bash-5.0# minlzma/minlzdec/minlzdec zeros.xz zeros
minlzdec v.1.1.1 -- http://ionescu007.github.io/minlzma
Copyright(c) 2020 Alex Ionescu (@aionescu)
Input file size: 60
Decompressed file will be 20 bytes (3.000000% ratio)
Decoding failed after 0 bytes
Just to show this doesn't happen purely on all-zero files; it can happen with "normal" files that just end at an unfortunate spot:
bash-5.0# wget -O- https://www.gutenberg.org/ebooks/16328.txt.utf-8 | dd bs=1 count=184645 | xz -C none -c > beowulf.xz
Connecting to www.gutenberg.org (152.19.134.47:443)
Connecting to www.gutenberg.org (152.19.134.47:80)
writing to stdout
- 27% |******************** | 83678 0:00:02 ETA184645+0 records in
184645+0 records out
bash-5.0# minlzma/minlzdec/minlzdec beowulf.xz beowulf
minlzdec v.1.1.1 -- http://ionescu007.github.io/minlzma
Copyright(c) 2020 Alex Ionescu (@aionescu)
Input file size: 61516
Decompressed file will be 184645 bytes (0.333158% ratio)
Decoding failed after 184626 bytes