* t1load.c (parse_blend_axis_types): Fix compiler warning. * src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta' to prevent infinite loop. * docs/VERSION.DLL: Provide better autoconf snippet to check FreeType version. * src/base/ftobjs.c (open_face): Free `internal' not `face->internal' in case of error to avoid possible segfault. * src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we actually have an outline.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
diff --git a/ChangeLog b/ChangeLog
index ec9f8ef..e4a1026 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-05-21 Martin Zinser <zinser@decus.de>
+
+ * t1load.c (parse_blend_axis_types): Fix compiler warning.
+
+2003-05-21 Weiqi Gao <weiqigao@networkusa.net>
+
+ * src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
+ to prevent infinite loop.
+
+2003-05-21 Lars Clausen <lrclause@cs.uiuc.edu>
+
+ * docs/VERSION.DLL: Provide better autoconf snippet to check
+ FreeType version.
+
+2003-05-21 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (open_face): Free `internal' not
+ `face->internal' in case of error to avoid possible segfault.
+
+ * src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
+ actually have an outline.
+
2003-05-20 David Chester <davidchester@qmx.net>
* src/pshinter/pshalgo3.c (ps3_hints_apply): Try to optimize
@@ -221,7 +243,7 @@
Updated.
* src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
- is declared twice. It is perhaps better to modify the zlip source
+ is declared twice. It is perhaps better to modify the zlib source
files directly instead of this hack.
(zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
to make build with g++ successful.
diff --git a/docs/VERSION.DLL b/docs/VERSION.DLL
index 10ccbfe..bba36cf 100644
--- a/docs/VERSION.DLL
+++ b/docs/VERSION.DLL
@@ -77,22 +77,27 @@ The libtool numbers are a bit inconsistent due to the library's history:
Lars Clausen contributed the following autoconf fragment to detect which
version of FreeType is installed on a system. This one tests for a
-version that is at least 2.0.9; you should change the last line to check
-against other release numbers.
-
- AC_MSG_CHECKING([for version of FreeType])
- FREETYPE_INCLUDE=`freetype-config --cflags | cut -c3-`
- FREETYPE_MAJOR=`grep '^#define FREETYPE_MAJOR' \
- $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3`
- FREETYPE_MINOR=`grep '^#define FREETYPE_MINOR' \
- $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3`
- FREETYPE_PATCH=`grep '^#define FREETYPE_PATCH' \
- $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3`
- FREETYPE_VERSION=`echo | awk "BEGIN { printf \"%d\", \
- ($FREETYPE_MAJOR * 1000 + $FREETYPE_MINOR) * 1000 \
- + $FREETYPE_PATCH;}"`
- AC_MSG_RESULT([$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH])
- if test "$FREETYPE_VERSION" -ge 2000009; then
+version that is at least 2.0.9; you should change it to check against
+other release numbers.
+
+
+ AC_MSG_CHECKING([whether FreeType version is 2.0.9 or higher])
+ old_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS=`freetype-config --cflags`
+ AC_TRY_CPP([
+#include <freetype/freetype.h>
+#if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2000009
+#error Freetype version too low.
+#endif
+ ],[
+ AC_MSG_RESULT(yes)
+ FREETYPE_LIBS=`freetype-config --libs`
+ AC_SUBST(FREETYPE_LIBS)
+ AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])
+ CPPFLAGS="$old_CPPFLAGS"
+ ],[
+ AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])
+ ])
--- end of VERSION.DLL ---
diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h
index cbe66d7..5e418f2 100644
--- a/include/freetype/internal/ftmemory.h
+++ b/include/freetype/internal/ftmemory.h
@@ -159,9 +159,6 @@ FT_BEGIN_HEADER
/* P :: This is the _address_ of a _pointer_ which points to the */
/* allocated block. It is always set to NULL on exit. */
/* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
/* <Note> */
/* If P or *P are NULL, this function should return successfully. */
/* This is a strong convention within all of FreeType and its */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 7a8c207..f20fd4e 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -853,7 +853,7 @@
FT_Face* aface )
{
FT_Memory memory;
- FT_Driver_Class clazz;
+ FT_Driver_Class clazz;
FT_Face face = 0;
FT_Error error, error2;
FT_Face_Internal internal;
@@ -916,7 +916,7 @@
if ( error )
{
clazz->done_face( face );
- FT_FREE( face->internal );
+ FT_FREE( internal );
FT_FREE( face );
*aface = 0;
}
@@ -1136,7 +1136,7 @@
if ( face_index == -1 )
face_index = 0;
if ( face_index != 0 )
- return FT_Err_Cannot_Open_Resource;
+ return error;
if ( FT_ALLOC( offsets, (FT_Long)resource_cnt * sizeof ( FT_Long ) ) )
return error;
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index d495800..8f37450 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -479,6 +479,8 @@
delta = (FT_ULong)( zip->limit - zip->cursor );
+ if ( delta == 0 )
+ break;
if ( delta >= count )
delta = count;
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index cf408a0..28ffd1a 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -1894,6 +1894,10 @@
FT_Int dimension;
+ /* something to do? */
+ if ( outline->n_points == 0 || outline->n_contours == 0 )
+ return FT_Err_Ok;
+
#ifdef DEBUG_HINTER
memory = globals->memory;
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 5103d9d..50b47db 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -425,7 +425,7 @@
token->start++;
len = token->limit - token->start;
- if ( len <= 0 )
+ if ( len == 0 )
{
error = T1_Err_Invalid_File_Format;
goto Exit;