diff options
author | Fred Bauer <fred.w.bauer@gmail.com> | 2011-09-26 18:13:34 +0000 |
---|---|---|
committer | Fred Bauer <fred.w.bauer@gmail.com> | 2011-09-26 18:13:34 +0000 |
commit | 01b36e889c9980cf80362ea83924d97d71b66d19 (patch) | |
tree | 4a99bb7d397806404024d8f3aa8b4c88690373ae | |
parent | 291c6be8e48fa956f9b87d5f9e34bf33faa1f479 (diff) | |
download | rockbox-01b36e889c9980cf80362ea83924d97d71b66d19.tar.gz 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
-rw-r--r-- | firmware/font.c | 9 |
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) | |||
172 | 172 | ||
173 | static int glyph_bytes( struct font *pf, int width ) | 173 | static int glyph_bytes( struct font *pf, int width ) |
174 | { | 174 | { |
175 | return pf->depth ? | 175 | int ret; |
176 | (pf->height * width + 1) / 2: | 176 | if (pf->depth) |
177 | width * ((pf->height + 7) / 8); | 177 | ret = ( pf->height * width + 1 ) / 2; |
178 | else | ||
179 | ret = width * ((pf->height + 7) / 8); | ||
180 | return (ret + 1) & ~1; | ||
178 | } | 181 | } |
179 | 182 | ||
180 | static struct font* font_load_header(struct font *pf) | 183 | static struct font* font_load_header(struct font *pf) |