1 /* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder
2 2016-05-16 : Igor Pavlov : Public domain */
12 SRes
Lzma86_GetUnpackSize(const Byte
*src
, SizeT srcLen
, UInt64
*unpackSize
)
15 if (srcLen
< LZMA86_HEADER_SIZE
)
16 return SZ_ERROR_INPUT_EOF
;
18 for (i
= 0; i
< sizeof(UInt64
); i
++)
19 *unpackSize
+= ((UInt64
)src
[LZMA86_SIZE_OFFSET
+ i
]) << (8 * i
);
23 SRes
Lzma86_Decode(Byte
*dest
, SizeT
*destLen
, const Byte
*src
, SizeT
*srcLen
)
30 if (*srcLen
< LZMA86_HEADER_SIZE
)
31 return SZ_ERROR_INPUT_EOF
;
38 return SZ_ERROR_UNSUPPORTED
;
41 inSizePure
= *srcLen
- LZMA86_HEADER_SIZE
;
42 res
= LzmaDecode(dest
, destLen
, src
+ LZMA86_HEADER_SIZE
, &inSizePure
,
43 src
+ 1, LZMA_PROPS_SIZE
, LZMA_FINISH_ANY
, &status
, &g_Alloc
);
44 *srcLen
= inSizePure
+ LZMA86_HEADER_SIZE
;
50 x86_Convert_Init(x86State
);
51 x86_Convert(dest
, *destLen
, 0, &x86State
, 0);