From 9b1c9db66e1c9c0fc55164ca6e7cf1b95399a7ca Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 27 Feb 2006 21:59:48 +0000 Subject: Fix stupid padded width calculation bug. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8862 a1c6a512-1295-4272-9138-f99709370657 --- tools/bmp2rb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bmp2rb.c b/tools/bmp2rb.c index 16bf7d9633..8de6ab2b56 100644 --- a/tools/bmp2rb.c +++ b/tools/bmp2rb.c @@ -159,7 +159,7 @@ int read_bmp_file(char* filename, width = readint(&fh.Width); height = readint(&fh.Height); - padded_width = (width * depth / 8 + 3) & ~3; /* aligned 4-bytes boundaries */ + padded_width = ((width * depth + 31) / 8) & ~3; /* aligned 4-bytes boundaries */ size = padded_width * height; /* read this many bytes */ bmp = (unsigned char *)malloc(size); -- cgit v1.2.3