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
This commit is contained in:
lgao4 2012-04-24 01:59:55 +00:00
parent b08b7ba451
commit 5cfe42344d
1 changed files with 8 additions and 2 deletions

View File

@ -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;