From 5a44a766b597e4c9960ac1936e6d18001c5e7ce2 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 5 May 2015 15:48:59 +0000 Subject: EmbeddedPkg/PrePiLib: Ensure the FFS files are always 8-byte aligned Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin Reviewed-by: Ronald Cron git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17308 6f19259b-4bc3-4df7-8a09-765794883524 --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'EmbeddedPkg/Library') diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/PrePiLib/FwVol.c index f73f1c0da4..530fc15dca 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -209,6 +209,9 @@ FindFileEx ( FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)*FileHeader + FileOccupiedSize); } + // FFS files begin with a header that is aligned on an 8-byte boundary + FfsFileHeader = ALIGN_POINTER (FfsFileHeader, 8); + FileOffset = (UINT32) ((UINT8 *)FfsFileHeader - (UINT8 *)FwVolHeader); ASSERT (FileOffset <= 0xFFFFFFFF); -- cgit v1.2.3