[U-Boot] [PATCH 1/8] video/console: Fix DM_VIDEO font glyph array indexing

Anatolij Gustschin agust at denx.de
Tue Apr 9 21:03:43 UTC 2019


On Sat, 23 Mar 2019 01:29:55 +0000
Andre Przywara andre.przywara at arm.com wrote:

> When the character to be printed on a DM_VIDEO console is from the
> "extended ASCII" range (0x80 - 0xff), it will be treated as a negative
> number, as it's declared as a signed char. This leads to negative array
> indicies into the glyph bitmap array, and random garbled characters.
> 
> Cast the character to an unsigned type to make the index always positive
> and avoid an out-of-bounds access.
> 
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
>  drivers/video/console_normal.c | 3 ++-
>  drivers/video/console_rotate.c | 7 ++++---
>  2 files changed, 6 insertions(+), 4 deletions(-)

Applied (with s/uint8_t/u8/) to u-boot-video/master, thanks!

--
Anatolij


More information about the U-Boot mailing list