mirror of https://github.com/acidanthera/audk.git
BaseTools: FMMT replace new free space fixing in replace
In FMMT replace function, when newffs size <= targetffs size, the new free space is calculated wrong as loss the pad data delta size. That will cause invalid binary generated. This patch fixes this issue. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
parent
bb13a4adab
commit
b5f5106c1e
|
@ -442,7 +442,7 @@ class FvHandler:
|
|||
# Start free space calculating and moving process.
|
||||
self.ModifyTest(TargetFv.Parent, Needed_Space)
|
||||
else:
|
||||
New_Free_Space = self.TargetFfs.Data.Size - self.NewFfs.Data.Size
|
||||
New_Free_Space = self.TargetFfs.Data.Size + len(self.TargetFfs.Data.PadData) - self.NewFfs.Data.Size - len(self.NewFfs.Data.PadData)
|
||||
# If TargetFv already have free space, move the new free space into it.
|
||||
if TargetFv.Data.Free_Space:
|
||||
TargetFv.Child[-1].Data.Data += b'\xff' * New_Free_Space
|
||||
|
|
Loading…
Reference in New Issue