ref: 3d568ac772be8445846dcce73e90242d774f5270
parent: eadc8df24db13359448af612f193685b5d7e08f7
author: Werner Lemberg <[email protected]>
date: Wed Oct 11 10:59:46 EDT 2000
A fix from Yamano'uchi to get correct font names.
--- 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;
}
}