summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-08-09 23:05:35 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-08-09 23:05:35 +0000
commit5aeaed8affd68c47c2c401e43c9eedca0f78b5d9 (patch)
treea762d5d19074221df9570ee2d6439daa44e7a09b /tools
parent4f6df497ff65df49ad53540206bd3c050d1f5315 (diff)
downloadrockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.tar.gz
rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.tar.bz2
rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.zip
convbdf: fixed a problem with 16 pixel wide characters. It now also refuses to convert fonts with >16 pixel characters, since it can't yet convert them correctly (bitmap_t is 16 bits wide).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7295 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/convbdf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c
index 0bb2d07c44..d38790b285 100644
--- a/tools/convbdf.c
+++ b/tools/convbdf.c
@@ -528,6 +528,11 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf)
maxwidth = width;
pf->width[encoding-pf->firstchar] = width;
+ if(maxwidth > 16) {
+ fprintf(stderr, "Error: Too wide characters (>16 pixels)\n");
+ return 0;
+ }
+
/* clear bitmap*/
memset(ch_bitmap, 0, BITMAP_BYTES(width) * pf->height);
@@ -743,8 +748,7 @@ int rotleft(unsigned char *dst, bitmap_t *src, unsigned int width,
src_mask >>= 1; /* next input bit */
if (src_mask == 0) /* input word done? */
{
- src_mask = 1 << (sizeof (bitmap_t) * 8 - 1);
- i++; /* next input word */
+ continue;
}
}