summaryrefslogtreecommitdiffstats
path: root/tools/bmp2rb.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bmp2rb.c')
-rw-r--r--tools/bmp2rb.c2
1 files changed, 1 insertions, 1 deletions
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);