freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Bug in t1load.c, parse_encoding() with octal numbers


From: Werner LEMBERG
Subject: Re: [Devel] Bug in t1load.c, parse_encoding() with octal numbers
Date: Wed, 21 Apr 2004 08:16:43 +0200 (CEST)

> 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.

Thanks for the report.  Please try the fix below (which is now in
the CVS).


    Werner


======================================================================


--- src/psaux/psobjs.c.old      Wed Feb 11 22:27:13 2004
+++ src/psaux/psobjs.c  Wed Apr 21 08:08:55 2004
@@ -688,9 +688,9 @@
   /* first character must be already part of the number */
 
   static FT_Long
-  T1Radix( FT_Long    radixBase,
-           FT_Byte*  *acur,
-           FT_Byte*   limit )
+  ps_radix( FT_Long    radixBase,
+            FT_Byte*  *acur,
+            FT_Byte*   limit )
   {
     FT_Long   result = 0;
     FT_Byte*  cur    = *acur;
@@ -716,6 +716,8 @@
       cur++;
     }
 
+    *acur = cur;
+
     return result;
   }
 
@@ -746,7 +748,7 @@
       if ( *cur == '#' )
       {
         cur++;
-        result = T1Radix( result, &cur, limit );
+        result = ps_radix( result, &cur, limit );
         break;
       }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]