]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update HiiFont Service to return error status instead of ASSERT for the invalid input.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 24 Apr 2012 01:59:55 +0000 (01:59 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 24 Apr 2012 01:59:55 +0000 (01:59 +0000)
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13209 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/HiiDatabaseDxe/Font.c

index 4d2fcc081b5cf4ee5a0c5f6d536b24cba5b48b93..66fc6b9781490e139856f79a550077323f67d43d 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