summaryrefslogtreecommitdiff
path: root/UefiPayloadPkg
diff options
context:
space:
mode:
authorSebastian Witt <sebastian.witt@siemens.com>2024-06-03 17:43:22 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-10 15:53:15 +0000
commit6d15276ceddd2bf05995ee2efa86316fca1cd73a (patch)
treeaec91360b41032871d445aa7e7d8abefd596c9a1 /UefiPayloadPkg
parent3dcc7b73df2b1c38c3c1a31724d577f4085f3ab1 (diff)
downloadedk2-6d15276ceddd2bf05995ee2efa86316fca1cd73a.zip
edk2-6d15276ceddd2bf05995ee2efa86316fca1cd73a.tar.gz
edk2-6d15276ceddd2bf05995ee2efa86316fca1cd73a.tar.bz2
UefiPayloadPkg: Fix LoadDxeCore for payload size > 16MB
Fix calculation of first section in FileFindSection for FILE2 headers in UefiPayloadEntry module. Signed-off-by: Sebastian Witt <sebastian.witt@siemens.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r--UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
index 898d610..3e13496 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
@@ -211,14 +211,15 @@ FileFindSection (
if (IS_FFS_FILE2 (FileHeader)) {
FileSize = FFS_FILE2_SIZE (FileHeader);
+ Section = (EFI_COMMON_SECTION_HEADER *)(((EFI_FFS_FILE_HEADER2 *)FileHeader) + 1);
} else {
FileSize = FFS_FILE_SIZE (FileHeader);
+ Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
}
FileSize -= sizeof (EFI_FFS_FILE_HEADER);
- Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
- Index = 0;
+ Index = 0;
while (Index < FileSize) {
if (Section->Type == SectionType) {
if (IS_SECTION2 (Section)) {