Mde UEFI library API implementation.\r
Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
\r
- Copyright (c) 2007 - 2009, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2007 - 2009, 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
http://opensource.org/licenses/bsd-license.php\r
EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto;\r
EFI_HANDLE ConsoleHandle;\r
+ UINTN Width;\r
+ UINTN Height;\r
+ UINTN Delta;\r
\r
HorizontalResolution = 0;\r
VerticalResolution = 0;\r
if (!EFI_ERROR (Status)) {\r
ASSERT (RowInfoArray != NULL);\r
//\r
- // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will\r
+ // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will\r
// always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.\r
//\r
ASSERT (RowInfoArraySize <= 1);\r
\r
+ if (RowInfoArraySize != 0) {\r
+ Width = RowInfoArray[0].LineWidth;\r
+ Height = RowInfoArray[0].LineHeight;\r
+ Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r
+ } else {\r
+ Width = 0;\r
+ Height = 0;\r
+ Delta = 0;\r
+ }\r
Status = UgaDraw->Blt (\r
UgaDraw,\r
(EFI_UGA_PIXEL *) Blt->Image.Bitmap,\r
PointY,\r
PointX,\r
PointY,\r
- RowInfoArray[0].LineWidth,\r
- RowInfoArray[0].LineHeight,\r
- Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
+ Width,\r
+ Height,\r
+ Delta\r
);\r
} else {\r
goto Error;\r
//\r
// Calculate the number of actual printed characters\r
//\r
- PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;\r
+ if (RowInfoArraySize != 0) {\r
+ PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;\r
+ } else {\r
+ PrintNum = 0;\r
+ }\r
\r
FreePool (RowInfoArray);\r
FreePool (Blt);\r