From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Tue, 9 Apr 2019 23:03:43 +0200 Subject: [U-Boot] [PATCH 1/8] video/console: Fix DM_VIDEO font glyph array indexing In-Reply-To: <20190323013002.27117-2-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> <20190323013002.27117-2-andre.przywara@arm.com> Message-ID: <20190409230343.7639ccb2@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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