mirror of https://github.com/acidanthera/audk.git
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:
parent
b08b7ba451
commit
5cfe42344d
|
@ -2,7 +2,7 @@
|
||||||
Implementation for EFI_HII_FONT_PROTOCOL.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1819,7 +1819,13 @@ HiiStringToImage (
|
||||||
//
|
//
|
||||||
Image = *Blt;
|
Image = *Blt;
|
||||||
BufferPtr = Image->Image.Bitmap + Image->Width * BltY + BltX;
|
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);
|
MaxRowNum = (UINT16) ((Image->Height - BltY) / Height);
|
||||||
if ((Image->Height - BltY) % Height != 0) {
|
if ((Image->Height - BltY) % Height != 0) {
|
||||||
LastLineHeight = (Image->Height - BltY) % Height;
|
LastLineHeight = (Image->Height - BltY) % Height;
|
||||||
|
|
Loading…
Reference in New Issue