X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FLibrary%2FLzmaCustomDecompressLib%2FLzmaDecompress.c;h=e32b6a3025b07f39a485e62dfc8917293ab4e6e5;hp=dd08008258919b3e99767ffcf7c1fed3b502f6c1;hb=180a5a35cb49699bd249dee19e41cee34c856a58;hpb=090d308851492a7b647fab6451fa1a1bb763d6d5 diff --git a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c index dd08008258..e32b6a3025 100644 --- a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c +++ b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompress.c @@ -1,8 +1,8 @@ /** @file LZMA Decompress interfaces - Copyright (c) 2009, Intel Corporation
- All rights reserved. This program and the accompanying materials + Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -41,7 +41,9 @@ SzAlloc ( ) { VOID *Addr; - ISzAllocWithData *Private = (ISzAllocWithData*) P; + ISzAllocWithData *Private; + + Private = (ISzAllocWithData*) P; if (Private->BufferSize >= Size) { Addr = Private->Buffer; @@ -162,6 +164,7 @@ LzmaUefiDecompressGetInfo ( then RETURN_INVALID_PARAMETER is returned. @param Source The source buffer containing the compressed data. + @param SourceSize The size of source buffer. @param Destination The destination buffer to store the decompressed data @param Scratch A temporary scratch buffer that is used to perform the decompression. This is an optional parameter that may be NULL if the @@ -182,17 +185,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 +208,7 @@ LzmaUefiDecompress ( LZMA_PROPS_SIZE, LZMA_FINISH_END, &Status, - (ISzAlloc*) &AllocFuncs + &(AllocFuncs.Functions) ); if (LzmaResult == SZ_OK) {