From 01b36e889c9980cf80362ea83924d97d71b66d19 Mon Sep 17 00:00:00 2001 From: Fred Bauer Date: Mon, 26 Sep 2011 18:13:34 +0000 Subject: glyph_bytes() should pad to an even number git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30606 a1c6a512-1295-4272-9138-f99709370657 --- firmware/font.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'firmware/font.c') 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) -- cgit