A fix from Yamano'uchi to get correct font names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index 815e1ed..c159435 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -96,7 +96,8 @@
buff_len = 256;
for (;;)
{
- FT_Byte *p, *limit = buffer + 256;
+ FT_Byte *p, *limit = buffer + 256;
+ FT_ULong top_position;
/* fill input buffer */
@@ -104,9 +105,12 @@
if ( buff_len > 0 )
MEM_Move( buffer, limit, buff_len );
- if ( FILE_Read( buffer, 256 + 10 - buff_len ) )
+ p = buffer + buff_len;
+
+ if ( FILE_Read( p, 256 + 10 - buff_len ) )
goto Exit;
+ top_position = FILE_Pos() - buff_len;
buff_len = 256 + 10;
/* look for `StartData' */
@@ -115,7 +119,7 @@
if ( p[0] == 'S' && strncmp( (char*)p, "StartData", 9 ) == 0 )
{
/* save offset of binary data after `StartData' */
- offset = FILE_Pos() - ( limit - p ) + 10;
+ offset = top_position - ( limit - p ) + 10;
goto Found;
}
}