[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Bug in t1load.c, parse_encoding() with octal numbers
From: |
Dave Formanek |
Subject: |
[Devel] Bug in t1load.c, parse_encoding() with octal numbers |
Date: |
Tue, 20 Apr 2004 08:41:19 -0600 |
On the line that reads:
charcode = (FT_Int)T1_ToInt( parser );
If parser->root.cursor is pointing at an octal number (e.g., 8#256), then
T1_ToInt will correctly convert the octal number but will leave the cursor
pointing at 256. This number will be picked up in the next iteration of the
loop (which it shouldn't) and it will be converted as a base 10 number,
causing an incorrect index into char_table->elements below. To workaround
this bug, we need to skip past any digits we are left pointing at here.
Here's how to fix the relevant code:
charcode = (FT_Int)T1_ToInt( parser );
// skip digits in case we're not base 10
if ( ft_isdigit( *parser->root.cursor ) ) {
cur = parser->root.cursor;
while ( ft_isdigit( *cur ) && ( cur < limit ) ) cur++;
parser->root.cursor = cur;
}
T1_Skip_Spaces( parser );
- [Devel] Bug in t1load.c, parse_encoding() with octal numbers,
Dave Formanek <=