From 5d02b8a1513e4e234bf270ab13df1898403e0607 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 15 Mar 2005 23:48:15 +0000 Subject: [PATCH] * src/bdf/bdflib.c: removing compiler warnings --- ChangeLog | 14 ++++++++++++++ src/bdf/bdflib.c | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0095ce491..42dcd2e73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2005-03-15 David Turner + * 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 !) diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index 9ac50beab..e14fd65ed 100644 --- 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;