summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-04 13:50:14 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-04 13:50:14 +0000
commit63fffe4e7227291ae5a74d0ee1b44ec2af0eff6a (patch)
treef7390b6e0dd5815e2ba6f26876776ef5705e8022 /MdePkg/Library
parentc8c44377af9ae3a175004d131f24b1348620baa2 (diff)
downloadedk2-63fffe4e7227291ae5a74d0ee1b44ec2af0eff6a.tar.gz
edk2-63fffe4e7227291ae5a74d0ee1b44ec2af0eff6a.tar.bz2
edk2-63fffe4e7227291ae5a74d0ee1b44ec2af0eff6a.zip
fix the issue when passing a L"" string to PrintXY.
1. According to the value of RowInfoArraySize to get the actual number of printed line. 2. If RowInfoArraySize equates 0, then it means nothing is printed. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8464 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/UefiLib/UefiLibPrint.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c
index 9dc3a5a200..55487259fc 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -347,6 +347,9 @@ InternalPrintGraphic (
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto;
EFI_HANDLE ConsoleHandle;
+ UINTN Width;
+ UINTN Height;
+ UINTN Delta;
HorizontalResolution = 0;
VerticalResolution = 0;
@@ -485,6 +488,15 @@ InternalPrintGraphic (
//
ASSERT (RowInfoArraySize <= 1);
+ if (RowInfoArraySize != 0) {
+ Width = RowInfoArray[0].LineWidth;
+ Height = RowInfoArray[0].LineHeight;
+ Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
+ } else {
+ Width = 0;
+ Height = 0;
+ Delta = 0;
+ }
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) Blt->Image.Bitmap,
@@ -493,9 +505,9 @@ InternalPrintGraphic (
PointY,
PointX,
PointY,
- RowInfoArray[0].LineWidth,
- RowInfoArray[0].LineHeight,
- Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ Width,
+ Height,
+ Delta
);
} else {
goto Error;
@@ -507,7 +519,11 @@ InternalPrintGraphic (
//
// Calculate the number of actual printed characters
//
- PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;
+ if (RowInfoArraySize != 0) {
+ PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;
+ } else {
+ PrintNum = 0;
+ }
FreePool (RowInfoArray);
FreePool (Blt);