Patchwork [U-Boot,6/7] tools, bmp_logo: fix index from uint16_t to int to allow bigger logos

login
register
mail settings
Submitter Heiko Schocher
Date Aug. 3, 2013, 5:22 a.m.
Message ID <1375507373-13785-7-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/264391/
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Comments

Heiko Schocher - Aug. 3, 2013, 5:22 a.m.
when generating the bmp_logo_bitmap, the index is casted
as an uint16_t. So bigger logos as 65535 bytes are converted wrong
Fix this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
---
 tools/bmp_logo.c | 2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
Anatolij Gustschin - Aug. 10, 2013, 9:02 a.m.
On Sat,  3 Aug 2013 07:22:52 +0200
Heiko Schocher <hs@denx.de> wrote:

> when generating the bmp_logo_bitmap, the index is casted
> as an uint16_t. So bigger logos as 65535 bytes are converted wrong
> Fix this.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>  tools/bmp_logo.c | 2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Applied to u-boot-video/master, thanks!

Anatolij

Patch

diff --git a/tools/bmp_logo.c b/tools/bmp_logo.c
index b2ad3d5..2247adc 100644
--- a/tools/bmp_logo.c
+++ b/tools/bmp_logo.c
@@ -179,7 +179,7 @@  int main (int argc, char *argv[])
 	printf("unsigned char bmp_logo_bitmap[] = {\n");
 	for (i=(b->height-1)*b->width; i>=0; i-=b->width) {
 		for (x = 0; x < b->width; x++) {
-			b->data[(uint16_t) i + x] = (uint8_t) fgetc (fp) \
+			b->data[i + x] = (uint8_t) fgetc(fp)
 						+ DEFAULT_CMAP_SIZE;
 		}
 	}