diff options
author | marha <marha@users.sourceforge.net> | 2011-07-18 10:51:09 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-18 10:51:09 +0200 |
commit | 3c0d2312573b81e3067bea610a58b1940c075e05 (patch) | |
tree | 3f025a27d813374f225957801226aa8ee829a33a /freetype/src/sfnt | |
parent | ba033884541714680fd7552ab9d6c8817650f7d8 (diff) | |
parent | 88101146f2ec7d53ffb793e365f05097ffd35fd3 (diff) | |
download | vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.tar.gz vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.tar.bz2 vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
X11/Xfuncproto.h.in
X11/configure.ac
X11/keysymdef.h
freetype/include/freetype/internal/pcftypes.h
freetype/src/cache/ftcbasic.c
freetype/src/cache/ftccmap.c
mesalib/src/glsl/ir.h
mesalib/src/glsl/link_functions.cpp
mesalib/src/mesa/main/dlist.c
mesalib/src/mesa/program/prog_optimize.c
mesalib/src/mesa/state_tracker/st_program.c
pthreads/Makefile
Diffstat (limited to 'freetype/src/sfnt')
-rw-r--r-- | freetype/src/sfnt/rules.mk | 5 | ||||
-rw-r--r-- | freetype/src/sfnt/sfdriver.c | 19 | ||||
-rw-r--r-- | freetype/src/sfnt/sfobjs.c | 17 | ||||
-rw-r--r-- | freetype/src/sfnt/ttload.c | 2 | ||||
-rw-r--r-- | freetype/src/sfnt/ttmtx.c | 4 | ||||
-rw-r--r-- | freetype/src/sfnt/ttsbit.c | 2 |
6 files changed, 33 insertions, 16 deletions
diff --git a/freetype/src/sfnt/rules.mk b/freetype/src/sfnt/rules.mk index abda74fca..02cee585d 100644 --- a/freetype/src/sfnt/rules.mk +++ b/freetype/src/sfnt/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by +# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -33,7 +33,8 @@ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \ $(SFNT_DIR)/ttkern.c \ $(SFNT_DIR)/ttbdf.c \ $(SFNT_DIR)/sfobjs.c \ - $(SFNT_DIR)/sfdriver.c + $(SFNT_DIR)/sfdriver.c \ + $(SFNT_DIR)/sfntpic.c # SFNT driver headers # diff --git a/freetype/src/sfnt/sfdriver.c b/freetype/src/sfnt/sfdriver.c index 77736f42c..9d008efd9 100644 --- a/freetype/src/sfnt/sfdriver.c +++ b/freetype/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ /* */ /* High-level SFNT driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ +/* Copyright 1996-2007, 2009-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -117,15 +117,20 @@ FT_ULong *offset, FT_ULong *length ) { - if ( !tag || !offset || !length ) + if ( !offset || !length ) return SFNT_Err_Invalid_Argument; - if ( idx >= face->num_tables ) - return SFNT_Err_Table_Missing; + if ( !tag ) + *length = face->num_tables; + else + { + if ( idx >= face->num_tables ) + return SFNT_Err_Table_Missing; - *tag = face->dir_tables[idx].Tag; - *offset = face->dir_tables[idx].Offset; - *length = face->dir_tables[idx].Length; + *tag = face->dir_tables[idx].Tag; + *offset = face->dir_tables[idx].Offset; + *length = face->dir_tables[idx].Length; + } return SFNT_Err_Ok; } diff --git a/freetype/src/sfnt/sfobjs.c b/freetype/src/sfnt/sfobjs.c index 449c6b000..10041e4dc 100644 --- a/freetype/src/sfnt/sfobjs.c +++ b/freetype/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ /* */ /* SFNT object management (base). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ +/* Copyright 1996-2008, 2010-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -356,7 +356,7 @@ FT_FRAME_START( 8 ), FT_FRAME_LONG( version ), - FT_FRAME_LONG( count ), + FT_FRAME_LONG( count ), /* this is ULong in the specs */ FT_FRAME_END }; @@ -390,6 +390,17 @@ if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) ) return error; + if ( face->ttc_header.count == 0 ) + return SFNT_Err_Invalid_Table; + + /* a rough size estimate: let's conservatively assume that there */ + /* is just a single table info in each subfont header (12 + 16*1 = */ + /* 28 bytes), thus we have (at least) `12 + 4*count' bytes for the */ + /* size of the TTC header plus `28*count' bytes for all subfont */ + /* headers */ + if ( (FT_ULong)face->ttc_header.count > stream->size / ( 28 + 4 ) ) + return SFNT_Err_Array_Too_Large; + /* now read the offsets of each font in the file */ if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) ) return error; @@ -536,7 +547,7 @@ FT_UNUSED( face_index ); /* Check parameters */ - + { FT_Int i; diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c index 65fa0015f..b0cb9fa77 100644 --- a/freetype/src/sfnt/ttload.c +++ b/freetype/src/sfnt/ttload.c @@ -1213,7 +1213,7 @@ FT_Memory memory = stream->memory; FT_UInt j,num_ranges; - TT_GaspRange gaspranges; + TT_GaspRange gaspranges = NULL; /* the gasp table is optional */ diff --git a/freetype/src/sfnt/ttmtx.c b/freetype/src/sfnt/ttmtx.c index 3b9f8606b..caa778c89 100644 --- a/freetype/src/sfnt/ttmtx.c +++ b/freetype/src/sfnt/ttmtx.c @@ -4,7 +4,7 @@ /* */ /* Load the metrics tables common to TTF and OTF fonts (body). */ /* */ -/* Copyright 2006, 2007, 2008, 2009 by */ +/* Copyright 2006-2009, 2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -163,7 +163,7 @@ { FT_TRACE0(( "tt_face_load_hmtx:" " %cmtx has more metrics than glyphs.\n", - vertical ? "v" : "h" )); + vertical ? 'v' : 'h' )); /* Adobe simply ignores this problem. So we shall do the same. */ #if 0 diff --git a/freetype/src/sfnt/ttsbit.c b/freetype/src/sfnt/ttsbit.c index efe8809f6..c138e0b2d 100644 --- a/freetype/src/sfnt/ttsbit.c +++ b/freetype/src/sfnt/ttsbit.c @@ -1343,7 +1343,7 @@ /* All right, we have a compound format. First of all, read */ /* the array of elements. */ { - TT_SBit_Component components; + TT_SBit_Component components = NULL; TT_SBit_Component comp; FT_UShort num_components, count; |