summaryrefslogtreecommitdiff
path: root/src/base/ftmac.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2004-03-20 14:26:38 +0000
committerWerner Lemberg <wl@gnu.org>2004-03-20 14:26:38 +0000
commit2630e54d2aee2785196c8a04fee3e0d8898c04cc (patch)
treece1ed6348718c8aecbcde9a16017d2c337c0246d /src/base/ftmac.c
parent0113f26b85bd5cdccc4c0983f98e91aa95a5528a (diff)
* src/sfnt/ttload.c (tt_face_load_sfnt_header): Reject face_index
values > 0 if loading non-TTC fonts. * src/base/ftmac.c (open_face_from_buffer): Set positive face_index to zero before calling FT_Open_Face. * docs/CHANGES: Updated.
Diffstat (limited to 'src/base/ftmac.c')
-rw-r--r--src/base/ftmac.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 87c277a2..d64f0107 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -611,6 +611,14 @@
args.driver = FT_Get_Module( library, driver_name );
}
+ /* At this point, face_index has served its purpose; */
+ /* whoever calls this function has already used it to */
+ /* locate the correct font data. We should not propagate */
+ /* this index to FT_Open_Face() (unless it is negative). */
+
+ if ( face_index > 0 )
+ face_index = 0;
+
error = FT_Open_Face( library, &args, face_index, aface );
if ( error == FT_Err_Ok )
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;