diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-12-04 05:35:15 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-12-05 01:49:52 +0100 |
commit | f68ab43de67f59925542efb6bcec30f4a84fe695 (patch) | |
tree | aa9a6c76783a1437326180aec13f3e3d4b01ab8b /lib_generic | |
parent | cccfc2ab77877dbdd2abe26b28d4c1f467feb0c0 (diff) | |
download | u-boot-imx-f68ab43de67f59925542efb6bcec30f4a84fe695.zip u-boot-imx-f68ab43de67f59925542efb6bcec30f4a84fe695.tar.gz u-boot-imx-f68ab43de67f59925542efb6bcec30f4a84fe695.tar.bz2 |
lzma: ignore unset filesizes
The Linux kernel build system changed how it compresses things with LZMA
such that the header no longer contains the filesize (it is instead set to
all F's). So if we get a LZMA image that has -1 for the 64bit field,
let's just assume that the decompressed size is unknown and continue on.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lib_generic')
-rw-r--r-- | lib_generic/lzma/LzmaTools.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib_generic/lzma/LzmaTools.c b/lib_generic/lzma/LzmaTools.c index 408b577..8860bfb 100644 --- a/lib_generic/lzma/LzmaTools.c +++ b/lib_generic/lzma/LzmaTools.c @@ -97,11 +97,14 @@ int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, } else if (outSizeHigh != 0 || (UInt32)(SizeT)outSize != outSize) { /* * SizeT is a 32 bit uint => We cannot manage files larger than - * 4GB! + * 4GB! Assume however that all 0xf values is "unknown size" and + * not actually a file of 2^64 bits. * */ - debug ("LZMA: 64bit support not enabled.\n"); - return SZ_ERROR_DATA; + if (outSizeHigh != (SizeT)-1 || outSize != (SizeT)-1) { + debug ("LZMA: 64bit support not enabled.\n"); + return SZ_ERROR_DATA; + } } debug ("LZMA: Uncompresed size............ 0x%lx\n", outSizeFull); |