diff options
author | Shenglei Zhang <shenglei.zhang@intel.com> | 2019-10-15 14:27:32 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-11-04 08:56:06 +0800 |
commit | df50c2fcd85e24cbece9f03f2879fdcc96096ab1 (patch) | |
tree | 270f3977ae783eb1101411046b89a9327f6516c6 /MdeModulePkg | |
parent | 121955fd4f9a2a5da7e0e8fe0c47ad5570f18d32 (diff) | |
download | edk2-df50c2fcd85e24cbece9f03f2879fdcc96096ab1.zip edk2-df50c2fcd85e24cbece9f03f2879fdcc96096ab1.tar.gz edk2-df50c2fcd85e24cbece9f03f2879fdcc96096ab1.tar.bz2 |
MdeModulePkg/HiiDatabaseDxe: ASSERT "Private->Attribute >> 4"
Foreground and background color are saved in a single byte.
Bits 0..3 are the foreground color and bits 4..6 are the background color.
If the Private->Attribute defined correctly, (Private->Attribute >> 4)
must be less than 8.
This commit uses ASSERT to assume "Attribute >> 4" is less than 8.
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index ca63df1..ee6c652 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -999,6 +999,7 @@ GetSystemFont ( }
Info->ForegroundColor = mHiiEfiColors[Private->Attribute & 0x0f];
+ ASSERT ((Private->Attribute >> 4) < 8);
Info->BackgroundColor = mHiiEfiColors[Private->Attribute >> 4];
Info->FontInfoMask = EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_SYS_STYLE;
Info->FontInfo.FontStyle = 0;
|