X-Git-Url: https://code.delx.au/refind/blobdiff_plain/4ca76581f99a008d91d8e8a3b10b80be6cc118be..ec097428f9fb581bb0842bb840b5713e176dd0f4:/libeg/text.c diff --git a/libeg/text.c b/libeg/text.c index d84eeb7..93551b2 100644 --- a/libeg/text.c +++ b/libeg/text.c @@ -64,7 +64,11 @@ VOID egRenderText(IN CHAR16 *Text, IN OUT EG_IMAGE *CompImage, IN UINTN PosX, IN UINTN i, c; // clip the text - TextLength = StrLen(Text); + if (Text) + TextLength = StrLen(Text); + else + TextLength = 0; + if (TextLength * FONT_CELL_WIDTH + PosX > CompImage->Width) TextLength = (CompImage->Width - PosX) / FONT_CELL_WIDTH;