diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 2c95e91ecc..467cd6a58d 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -426,7 +426,7 @@ TranslateBmpToGopBlt ( } - ImageIndex = (UINTN)(Image - ImageHeader); + ImageIndex = (UINTN)Image - (UINTN)ImageHeader; if ((ImageIndex % 4) != 0) { // // Bmp Image starts each row on a 32-bit boundary!