Decompression Source Code
Version 1.10 12/01/02 I-5
if (Sd->mBadTableFlag != 0) {
//
// Something wrong with the source
//
return EFI_INVALID_PARAMETER;
}
for (Index = 0; Index < Count; Index ++) {
if (Dst1 < Dst + DstSize) {
*Dst1++ = Sd->mBuffer[Index];
} else {
return EFI_INVALID_PARAMETER;
}
}
Sd->mOrigSize -= Count;
}
if (Sd->mBadTableFlag != 0) {
Status = EFI_INVALID_PARAMETER;
} else {
Status = EFI_SUCCESS;
}
return Status;
}
STATIC
VOID
FillBuf (
IN SCRATCH_DATA *Sd,
IN UINT16 NumOfBits
)
/*++
Routine Description:
Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
Arguments:
Sd - The global scratch data
NumOfBit - The number of bits to shift and read.
Returns: (VOID)
--*/
{
Sd->mBitBuf = (UINT16)(Sd->mBitBuf << NumOfBits);
while (NumOfBits > Sd->mBitCount) {
Sd->mBitBuf |= (UINT16)(Sd->mSubBitBuf <<
(NumOfBits = (UINT16)(NumOfBits - Sd->mBitCount)));
if (Sd->mCompSize > 0) {