]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
ShellPkg: Fix calls to SimpleTextOut->SetAttribute to not use reserved bits
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditTitleBar.c
index 23d26105c2ccd01bb36300db280b0a3e1dc35342..ce7a2520ce52b14d8dbc39ddbb7ee0733feb9f3d 100644 (file)
@@ -2,7 +2,7 @@
   Implements titlebar interface functions.\r
 \r
   Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2005 - 2014, 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
@@ -109,10 +109,10 @@ MainTitleBarRefresh (
   //\r
   Orig.Data             = gST->ConOut->Mode->Attribute;\r
   New.Data              = 0;\r
-  New.Colors.Foreground = Orig.Colors.Background;\r
-  New.Colors.Background = Orig.Colors.Foreground;\r
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;\r
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;\r
 \r
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);\r
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);\r
 \r
   //\r
   // clear the title line\r