]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lzma: ignore unset filesizes
authorMike Frysinger <vapier@gentoo.org>
Fri, 4 Dec 2009 10:35:15 +0000 (05:35 -0500)
committerWolfgang Denk <wd@denx.de>
Sat, 5 Dec 2009 00:49:52 +0000 (01:49 +0100)
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>
lib_generic/lzma/LzmaTools.c

index 408b577f17a387a6434a843de73793a15102df86..8860bfbf3da0dd019104668491868d46f5a8be11 100644 (file)
@@ -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);