Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xca] Handle blocks which cross 64kB boundaries
The XCA compression scheme as used in bootmgr was found to split the output into 64kB chunks, with a new Huffman symbol length table for each chunk. This behaviour is not documented in the XCA specification, but was discovered empirically. We currently make the assumption that the compression algorithm first splits the output into 64kB chunks, then compresses each chunk separately (while retaining the ability to refer back to previous chunks via LZ77 match symbols). However, some examples have been found in which a single LZ77 match symbol crosses a 64kB boundary within the output stream. This suggests the the compression algorithm starts a new chunk after it has compressed at least 64kB (rather than using a fixed 64kB chunk length). Experiments indicate that changing the decompressor to start a new chunk whenever at least 64kB have been decompressed produces the correct output. Reported-by: Brian Rak <brak@gameservers.com> Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Reported-by: Sven Dreyer <sven@dreyer-net.de> Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
- Loading branch information