mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction
Since the pointer subtraction here is not performed by pointers to elements of the same array object. This might lead to potential issues, such behavior is undefined according to C11 standard. Refine the pointer subtraction expressions by casting each pointer to UINTN first and then perform the subtraction. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
7ff68b5edc
commit
99576ee3fd
|
@ -426,7 +426,7 @@ TranslateBmpToGopBlt (
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageIndex = (UINTN)(Image - ImageHeader);
|
ImageIndex = (UINTN)Image - (UINTN)ImageHeader;
|
||||||
if ((ImageIndex % 4) != 0) {
|
if ((ImageIndex % 4) != 0) {
|
||||||
//
|
//
|
||||||
// Bmp Image starts each row on a 32-bit boundary!
|
// Bmp Image starts each row on a 32-bit boundary!
|
||||||
|
|
Loading…
Reference in New Issue