shithub: freetype+ttf2subf

Download patch

ref: 5d02b8a1513e4e234bf270ab13df1898403e0607
parent: 58609c40c8406a7ddc524f61affcdab16c55472d
author: David Turner <[email protected]>
date: Tue Mar 15 18:48:15 EST 2005

* src/bdf/bdflib.c: removing compiler warnings

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2005-03-15  David Turner  <[email protected]>
 
+    * src/bdf/bdflib.c: removing compiler warnings
+
+    * docs/CHANGES: updating
+    
+    * src/type1/t1parse.c (T1_New_Parser), src/type42/t42parse.c
+    (t42_parser_init): modifying functions to check the font header before
+    allocating anything on the heap.
+
+    * internal/freetype/ftmemory.h: introducing the new macros FT_ARRAY_MAX
+    and FT_ARRAY_CHECK
+    
+    * src/pcf/pcfread.c, src/pcf/pcfutil.c: minor fixes and simplifications.
+    try to protect the PCF driver from doing stupid things with broken fonts.
+
     * src/lzw/ftlzw.c (FT_Stream_OpenLZW): modified the function to check
     the LZW header before doing anything else. This helps avoid un-necessary
     heap allocations (400 Kb of heap memory for the LZW decoder ! Oh my !)
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -415,7 +415,7 @@
   {
     FT_Error  error = 0;
 
-    if ( num_items > list->size )
+    if ( num_items > (int)list->size )
     {
       int  oldsize = list->size;
       int  newsize = oldsize + (oldsize >> 1) + 4;
@@ -637,12 +637,13 @@
     cursor     = 0;
     refill     = 1;
     to_skip    = NO_SKIP;
+    bytes      = 0;  /* make compiler happy */
 
     for (;;)
     {
       if ( refill )
       {
-        bytes = (int) FT_Stream_TryRead( stream, buf + cursor,
+        bytes = (int) FT_Stream_TryRead( stream, (FT_Byte*)buf + cursor,
                                          (FT_ULong)(buf_size - cursor) );
         avail  = cursor + bytes;
         cursor = 0;