summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c
index dd08008..5c89d98 100644
--- a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c
+++ b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c
@@ -182,17 +182,18 @@ LzmaUefiDecompress (
IN OUT VOID *Scratch
)
{
- SRes LzmaResult;
- ELzmaStatus Status;
- SizeT DecodedBufSize;
- SizeT EncodedDataSize;
- ISzAllocWithData AllocFuncs = {
- { SzAlloc, SzFree },
- Scratch,
- SCRATCH_BUFFER_REQUEST_SIZE
- };
-
- DecodedBufSize = GetDecodedSizeOfBuf((UINT8*)Source);
+ SRes LzmaResult;
+ ELzmaStatus Status;
+ SizeT DecodedBufSize;
+ SizeT EncodedDataSize;
+ ISzAllocWithData AllocFuncs;
+
+ AllocFuncs.Functions.Alloc = SzAlloc;
+ AllocFuncs.Functions.Free = SzFree;
+ AllocFuncs.Buffer = Scratch;
+ AllocFuncs.BufferSize = SCRATCH_BUFFER_REQUEST_SIZE;
+
+ DecodedBufSize = (SizeT)GetDecodedSizeOfBuf((UINT8*)Source);
EncodedDataSize = (SizeT) (SourceSize - LZMA_HEADER_SIZE);
LzmaResult = LzmaDecode(
@@ -204,7 +205,7 @@ LzmaUefiDecompress (
LZMA_PROPS_SIZE,
LZMA_FINISH_END,
&Status,
- (ISzAlloc*) &AllocFuncs
+ &(AllocFuncs.Functions)
);
if (LzmaResult == SZ_OK) {