[U-Boot] [PATCH 1/2] video: fix bug in logo_plot

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat Aug 9 10:21:59 CEST 2008


On 18:00 Fri 08 Aug     , Anatolij Gustschin wrote:
> 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 at denx.de>
> ---
>  drivers/video/cfb_console.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 68b9861..97a37ba 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -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);
why not simplify it?
> +	unsigned char *dest = (unsigned char *)screen +
> +			      ((y * width + x) * VIDEO_PIXEL_SIZE);
>  
>  #ifdef CONFIG_VIDEO_BMP_LOGO
>  	source = bmp_logo_bitmap;
> -- 
> 1.5.4.3
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



More information about the U-Boot mailing list