]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
cfb_console: fix RLE bitmap drawing code
authorAnatolij Gustschin <agust@denx.de>
Mon, 21 Feb 2011 20:33:29 +0000 (21:33 +0100)
committerAnatolij Gustschin <agust@denx.de>
Thu, 28 Apr 2011 19:30:46 +0000 (21:30 +0200)
commit74446b63dd4ec386fc5de554d5c4a3536096072f
tree43e21408379b18a47ca04285a0ac178c639a1429
parenta000b7950da938d2df37ec5e081cd0680e6e4bbe
cfb_console: fix RLE bitmap drawing code

There seems to be tools producing incorrect 'end of bitmap data'
markers '0100' in a RLE bitmap. Drawing such bitmaps can result
in overwriting memory above the frame buffer. E.g. on MPC5121e
based boards this memory can contain U-Boot environment.

We may not rely on the correct end of bitmap data marker 0001
only, but also have to check whether we are going to draw a
valid frame buffer scan line.

The patch provides a fix by maintaining a pixel counter
which is incremented by the amount of pixels we are going
to draw. If the counter exceeds frame buffer pixels limit
we stop the drawing with the error message.

Reported-by: Michael Weiss <michael.weiss@ifm.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
drivers/video/cfb_console.c