]> git.ipfire.org Git - thirdparty/u-boot.git/commit
video/console: Fix DM_VIDEO font glyph array indexing
authorAndre Przywara <andre.przywara@arm.com>
Sat, 23 Mar 2019 01:29:55 +0000 (01:29 +0000)
committerAnatolij Gustschin <agust@denx.de>
Sun, 14 Apr 2019 12:18:47 +0000 (14:18 +0200)
commit96c9bf7e2ae2ac331574cf5017a0381d184a45a8
treefb43f147d49ce3f8cd4a13005503cea066a663cc
parent57e7775413cfd4ada728c4e60df64895dfa37e4e
video/console: Fix DM_VIDEO font glyph array indexing

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@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/video/console_normal.c
drivers/video/console_rotate.c