summaryrefslogtreecommitdiffstats
path: root/firmware/font.c
diff options
context:
space:
mode:
authorFred Bauer <fred.w.bauer@gmail.com>2011-09-26 18:13:34 +0000
committerFred Bauer <fred.w.bauer@gmail.com>2011-09-26 18:13:34 +0000
commit01b36e889c9980cf80362ea83924d97d71b66d19 (patch)
tree4a99bb7d397806404024d8f3aa8b4c88690373ae /firmware/font.c
parent291c6be8e48fa956f9b87d5f9e34bf33faa1f479 (diff)
downloadrockbox-01b36e889c9980cf80362ea83924d97d71b66d19.tar.gz
rockbox-01b36e889c9980cf80362ea83924d97d71b66d19.tar.bz2
rockbox-01b36e889c9980cf80362ea83924d97d71b66d19.zip
glyph_bytes() should pad to an even number
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30606 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/font.c')
-rw-r--r--firmware/font.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 4fd7325fdf..2be90355db 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -172,9 +172,12 @@ static int32_t readlong(struct font *pf)
static int glyph_bytes( struct font *pf, int width )
{
- return pf->depth ?
- (pf->height * width + 1) / 2:
- width * ((pf->height + 7) / 8);
+ int ret;
+ if (pf->depth)
+ ret = ( pf->height * width + 1 ) / 2;
+ else
+ ret = width * ((pf->height + 7) / 8);
+ return (ret + 1) & ~1;
}
static struct font* font_load_header(struct font *pf)