summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-08-02 15:54:23 +0300
committerTom Rini <trini@konsulko.com>2021-08-02 15:54:23 +0300
commit73994c452fc5a960114360a651201ac48b135e81 (patch)
tree6a70a64de049b6fe1876b2ddff76a52e5637aa0a /drivers
parent99bb5f248ade371ee4713e0ef51401708ecbb13c (diff)
parent78e6b871fdcf4bb86c6d7292a0e5d4a98e1435b6 (diff)
downloadu-boot-73994c452fc5a960114360a651201ac48b135e81.tar.xz
Merge tag 'efi-2021-10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2021-10-rc2 Documentation: * handle 'make htmldocs' warnings as errors * add missing board/ti/index.rst Bug fixes: * avoid buffer overrun in TrueType console * lib: disable CONFIG_SPL_HEXDUMP by default
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console_truetype.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index fa11b3bbef..98427f4c61 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -128,38 +128,36 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr)
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
struct console_tt_priv *priv = dev_get_priv(dev);
void *end, *line;
- int pixels = priv->font_size * vid_priv->line_length;
- int i, ret;
+ int ret;
line = vid_priv->fb + row * priv->font_size * vid_priv->line_length;
+ end = line + priv->font_size * vid_priv->line_length;
+
switch (vid_priv->bpix) {
#ifdef CONFIG_VIDEO_BPP8
case VIDEO_BPP8: {
- uint8_t *dst = line;
+ u8 *dst;
- for (i = 0; i < pixels; i++)
- *dst++ = clr;
- end = dst;
+ for (dst = line; dst < (u8 *)end; ++dst)
+ *dst = clr;
break;
}
#endif
#ifdef CONFIG_VIDEO_BPP16
case VIDEO_BPP16: {
- uint16_t *dst = line;
+ u16 *dst = line;
- for (i = 0; i < pixels; i++)
- *dst++ = clr;
- end = dst;
+ for (dst = line; dst < (u16 *)end; ++dst)
+ *dst = clr;
break;
}
#endif
#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
- uint32_t *dst = line;
+ u32 *dst = line;
- for (i = 0; i < pixels; i++)
- *dst++ = clr;
- end = dst;
+ for (dst = line; dst < (u32 *)end; ++dst)
+ *dst = clr;
break;
}
#endif