summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Library
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2015-05-05 15:48:59 +0000
committeroliviermartin <oliviermartin@Edk2>2015-05-05 15:48:59 +0000
commit5a44a766b597e4c9960ac1936e6d18001c5e7ce2 (patch)
tree02301d8fd8780a9859ecfe23be4b74dbfd10e0f7 /EmbeddedPkg/Library
parent0b1b3bda4d1a345f5967879263ed93d561ac8f00 (diff)
downloadedk2-platforms-5a44a766b597e4c9960ac1936e6d18001c5e7ce2.tar.xz
EmbeddedPkg/PrePiLib: Ensure the FFS files are always 8-byte aligned
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17308 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/Library')
-rw-r--r--EmbeddedPkg/Library/PrePiLib/FwVol.c3
1 files changed, 3 insertions, 0 deletions
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);