]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
video: fix bug in logo_plot
authorAnatolij Gustschin <agust@denx.de>
Fri, 8 Aug 2008 16:00:39 +0000 (18:00 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 10 Aug 2008 22:24:04 +0000 (00:24 +0200)
If logo_plot() should ever be called with x starting
position other than zero and for pixel depths greater
than 8bpp, logo colors distortion will be observed.
This patch fixes the issue.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
drivers/video/cfb_console.c

index 68b9861d41ff9042c2db8c76665f789e3be5b829..97a37ba50c7514f23206e71e2deadc82fba3ed99 100644 (file)
@@ -1071,7 +1071,9 @@ void logo_plot (void *screen, int width, int x, int y)
        int ycount = VIDEO_LOGO_HEIGHT;
        unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
        unsigned char *source;
-       unsigned char *dest = (unsigned char *)screen + ((y * width * VIDEO_PIXEL_SIZE) + x);
+       unsigned char *dest = (unsigned char *)screen +
+                             ((y * width * VIDEO_PIXEL_SIZE) +
+                              x * VIDEO_PIXEL_SIZE);
 
 #ifdef CONFIG_VIDEO_BMP_LOGO
        source = bmp_logo_bitmap;