The xz format supports concatenated files, images are sometimes created
and shipped with it to increase compression.
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1742744 is
the source bug for this issue.
if (memcmp(data, xz_signature, sizeof(xz_signature)) == 0) {
lzma_ret xzr;
- xzr = lzma_stream_decoder(&c->xz, UINT64_MAX, LZMA_TELL_UNSUPPORTED_CHECK);
+ xzr = lzma_stream_decoder(&c->xz, UINT64_MAX, LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED);
if (xzr != LZMA_OK)
return -EIO;