Skip to content

Commit 43fde94

Browse files
committed
MdeModulePkg/BrotliCustomDecompressLib: Correct BrotliDecompress
DestSize should have been received and passed as a pointer in order to successfully pass the output value. The existence of this error was spotted by XCODE5 toolchain, which gave: BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used As discussed in #11729, since the method is in fact internal and only called in one place, and since the DestSize return value is in fact unused, instead of fixing the parameter and method call we instead remove the parameter, also marking the method STATIC and renaming it to ...Internal. Signed-off-by: Mike Beaton <[email protected]>
1 parent 49d4753 commit 43fde94

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ BrFree (
6868
@param Source The source buffer containing the compressed data.
6969
@param SourceSize The size of source buffer.
7070
@param Destination The destination buffer to store the decompressed data.
71-
@param DestSize The destination buffer size.
7271
@param BuffInfo The pointer to the BROTLI_BUFF instance.
7372
7473
@retval EFI_SUCCESS Decompression completed successfully, and
@@ -77,12 +76,12 @@ BrFree (
7776
The source buffer specified by Source is corrupted
7877
(not in a valid compressed format).
7978
**/
79+
STATIC
8080
EFI_STATUS
81-
BrotliDecompress (
81+
BrotliDecompressInternal (
8282
IN CONST VOID *Source,
8383
IN UINTN SourceSize,
8484
IN OUT VOID *Destination,
85-
IN OUT UINTN DestSize,
8685
IN VOID *BuffInfo
8786
)
8887
{
@@ -157,8 +156,6 @@ BrotliDecompress (
157156
CopyMem (Temp, Output, (size_t)(NextOut - Output));
158157
}
159158

160-
DestSize = TotalOut;
161-
162159
BrFree (BuffInfo, Input);
163160
BrFree (BuffInfo, Output);
164161
BrotliDecoderDestroyInstance (BroState);
@@ -288,11 +285,10 @@ BrotliUefiDecompress (
288285
BroBuff.Buff = Scratch;
289286
BroBuff.BuffSize = (UINTN)GetSize;
290287

291-
Status = BrotliDecompress (
288+
Status = BrotliDecompressInternal (
292289
(VOID *)((UINT8 *)Source + BROTLI_SCRATCH_MAX),
293290
SourceSize - BROTLI_SCRATCH_MAX,
294291
Destination,
295-
DestSize,
296292
(VOID *)(&BroBuff)
297293
);
298294

0 commit comments

Comments
 (0)