]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
Fixed build failed.
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Font.c
index 4d2fcc081b5cf4ee5a0c5f6d536b24cba5b48b93..f6f784e733c202f367479f8f19a88ec8dbbf8fd8 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for EFI_HII_FONT_PROTOCOL.\r
 \r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, 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
@@ -1819,7 +1819,13 @@ HiiStringToImage (
   //\r
   Image     = *Blt;\r
   BufferPtr = Image->Image.Bitmap + Image->Width * BltY + BltX;\r
-  ASSERT (Image->Height >= BltY);\r
+  if (Image->Height < BltY) {\r
+    //\r
+    // the top edge of the image should be in Image resolution scope.\r
+    //\r
+    Status = EFI_INVALID_PARAMETER;\r
+    goto Exit;\r
+  }\r
   MaxRowNum = (UINT16) ((Image->Height - BltY) / Height);\r
   if ((Image->Height - BltY) % Height != 0) {\r
     LastLineHeight = (Image->Height - BltY) % Height;\r
@@ -2362,7 +2368,7 @@ HiiStringIdToImage (
   if (Language == NULL) {\r
     Language = "";\r
   }\r
-  CurrentLanguage = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&CurrentLanguage, NULL);\r
   BestLanguage = GetBestLanguage (\r
                    SupportedLanguages,\r
                    FALSE,\r