glyph_bytes() should pad to an even number

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30606 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Fred Bauer 2011-09-26 18:13:34 +00:00
parent 291c6be8e4
commit 01b36e889c

View file

@ -172,9 +172,12 @@ static int32_t readlong(struct font *pf)
static int glyph_bytes( struct font *pf, int width ) static int glyph_bytes( struct font *pf, int width )
{ {
return pf->depth ? int ret;
(pf->height * width + 1) / 2: if (pf->depth)
width * ((pf->height + 7) / 8); 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) static struct font* font_load_header(struct font *pf)