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: Dave Formanek
Subject: RE: [Devel] Bug in t1load.c, parse_encoding() with octal numbers
Date: Wed, 21 Apr 2004 07:03:28 -0600

The fix works and you made it in a better place than I did.

Thanks,
Dave 

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf
Of Werner LEMBERG
Sent: Wednesday, April 21, 2004 12:17 AM
To: address@hidden; address@hidden
Subject: Re: [Devel] Bug in t1load.c, parse_encoding() with octal numbers

> 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;
       }
 


_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel





reply via email to

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