summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2017-04-12 11:21:52 +0800
committerHao Wu <hao.a.wu@intel.com>2017-04-18 15:56:22 +0800
commitf76bc44362e5f0a2ea509c07b2f6846bd9833ee8 (patch)
tree33276db9754832872ef163db5fff2aba54de792f /BaseTools/Source/Python
parentd508fe87fe73f1e99c5e71ff2aa49459cbe68d2f (diff)
downloadedk2-f76bc44362e5f0a2ea509c07b2f6846bd9833ee8.zip
edk2-f76bc44362e5f0a2ea509c07b2f6846bd9833ee8.tar.gz
edk2-f76bc44362e5f0a2ea509c07b2f6846bd9833ee8.tar.bz2
MdeModulePkg/HiiDB: Avoid incorrect results of multiplication
An example: The codes in function Output8bitPixel in Image.c: OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos); Both Image->Width and Ypos are of type UINT16. They will be promoted to int (signed) first, and then perform the multiplication defined by macro BITMAP_LEN_8_BIT. If the result of multiplication between Image->Width and Ypos exceeds the range of type int, a potential incorrect results will be assigned to OffsetY. This commit adds explicit UINT32 type cast for 'Image->Width' to avoid possible overflow in the int range. And also fix similar issues in HiiDatabase. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
0 files changed, 0 insertions, 0 deletions