summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-24 01:59:55 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-24 01:59:55 +0000
commit5cfe42344d342a082663d3fc221a3c1bb4e71e81 (patch)
tree3e7bf7305978dd5c3a7afe273ad9875d647a0f15 /MdeModulePkg/Universal
parentb08b7ba4516f0c7dbe34aa4f9166d41cd9fb4c84 (diff)
downloadedk2-platforms-5cfe42344d342a082663d3fc221a3c1bb4e71e81.tar.xz
Update HiiFont Service to return error status instead of ASSERT for the invalid input.
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
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Font.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
index 4d2fcc081b..66fc6b9781 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -2,7 +2,7 @@
Implementation for EFI_HII_FONT_PROTOCOL.
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1819,7 +1819,13 @@ HiiStringToImage (
//
Image = *Blt;
BufferPtr = Image->Image.Bitmap + Image->Width * BltY + BltX;
- ASSERT (Image->Height >= BltY);
+ if (Image->Height < BltY) {
+ //
+ // the top edge of the image should be in Image resolution scope.
+ //
+ Status = EFI_INVALID_PARAMETER;
+ goto Exit;
+ }
MaxRowNum = (UINT16) ((Image->Height - BltY) / Height);
if ((Image->Height - BltY) % Height != 0) {
LastLineHeight = (Image->Height - BltY) % Height;