diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-08-09 23:05:35 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-08-09 23:05:35 +0000 |
| commit | 5aeaed8affd68c47c2c401e43c9eedca0f78b5d9 (patch) | |
| tree | a762d5d19074221df9570ee2d6439daa44e7a09b /tools/convbdf.c | |
| parent | 4f6df497ff65df49ad53540206bd3c050d1f5315 (diff) | |
| download | rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.zip rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.tar.gz rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.tar.bz2 rockbox-5aeaed8affd68c47c2c401e43c9eedca0f78b5d9.tar.xz | |
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/convbdf.c')
| -rw-r--r-- | tools/convbdf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c index 0bb2d07..d38790b 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; } } |