Update ffsparser.cpp

This commit is contained in:
Alex Matrosov 2017-12-10 21:39:47 -08:00 committed by GitHub
parent 63088afd87
commit 8fb214c322

View File

@ -956,7 +956,7 @@ USTATUS FfsParser::parseVolumeHeader(const UByteArray & volume, const UINT32 loc
} }
else if (volumeHeader->Revision == 2) { else if (volumeHeader->Revision == 2) {
// Acquire alignment // Acquire alignment
alignment = (UINT32)pow(2.0, (INT32)(volumeHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16); alignment = (UINT32)(1UL << ((volumeHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16));
// Check alignment // Check alignment
if (!isUnknown && !model->compressed(parent) && ((model->offset(parent) + localOffset - capsuleOffsetFixup) % alignment)) if (!isUnknown && !model->compressed(parent) && ((model->offset(parent) + localOffset - capsuleOffsetFixup) % alignment))
msgUnaligned = true; msgUnaligned = true;