Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/edk2/+/58785 )
Change subject: BmpSupportLib: fix BMP validation ......................................................................
BmpSupportLib: fix BMP validation
BMP files by tools other than MS paint can have a variable number of padding bytes, which results in the DataSize being less than (ImageSize - HeaderSize). Fix the check to be less stringent.
Test: use BMP created by/saved by Photoshop
Signed-off-by: Matt DeVillier matt.devillier@gmail.com Change-Id: I97d2e90aef7043a28b3bdda2eab52cb19e086930 Reviewed-on: https://review.coreboot.org/c/edk2/+/58785 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 3ac31f6..944d01f 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -213,7 +213,7 @@
if ((BmpHeader->Size != BmpImageSize) || (BmpHeader->Size < BmpHeader->ImageOffset) || - (BmpHeader->Size - BmpHeader->ImageOffset != DataSize)) { + (BmpHeader->Size - BmpHeader->ImageOffset < DataSize)) {
DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... \n")); DEBUG ((DEBUG_ERROR, " BmpHeader->Size: 0x%x\n", BmpHeader->Size));
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.