]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
MdeModulePkg: Refine type cast for pointer subtraction
[mirror_edk2.git] / MdeModulePkg / Library / DxeCapsuleLibFmp / DxeCapsuleLib.c
index 71e05bd55783a83aeae4d0468009bca49d29a36f..d7abcc879b5abdba7a520efc8f705ae90b38c7ad 100644 (file)
@@ -10,7 +10,7 @@
   ValidateFmpCapsule(), DisplayCapsuleImage(), ConvertBmpToGopBlt() will\r
   receive untrusted input and do basic validation.\r
 \r
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -547,7 +547,7 @@ ConvertBmpToGopBlt (
 \r
     }\r
 \r
-    ImageIndex = (UINTN) (Image - ImageHeader);\r
+    ImageIndex = (UINTN) Image - (UINTN) ImageHeader;\r
     if ((ImageIndex % 4) != 0) {\r
       //\r
       // Bmp Image starts each row on a 32-bit boundary!\r