From: Vadim Bendebury <vben...@chromium.org>

The cfb console driver is trying to prevent bitmaps to spill over the
screen, but the calculations assume that at least part of the bitmap
fits into the screen area. In reality there could be bitmap elements
which are completely out of the screen area, they just need to be
discarded.

Signed-off-by: Vadim Bendebury <vben...@chromium.org>

Signed-off-by: Simon Glass <s...@chromium.org>
---
 drivers/video/cfb_console.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c39d896..62ae4ee 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1201,6 +1201,13 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 
        padded_line = (((width * bpp + 7) / 8) + 3) & ~0x3;
 
+       /*
+        * Just ignore elements which are completely beyond screen
+        * dimensions.
+        */
+       if ((x >= VIDEO_VISIBLE_COLS) || (y >= VIDEO_VISIBLE_ROWS))
+               return 0;
+
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
        if (x == BMP_ALIGN_CENTER)
                x = max(0, (VIDEO_VISIBLE_COLS - width) / 2);
-- 
1.7.7.3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to