Alexei Podtelezhnikov
78c02bc110
[type1,type42] Use `const' for string literals.
...
* include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated.
* include/freetype/internal/t1types.h (T1_EncodingRec): Updated.
* src/psaux/psobjs.[ch] (ps_table_add): Updated.
* src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated.
* src/type42/t42objs.c (T42_Open_Face): Updated.
* src/type42/t42parse.c (t42_parse_encoding): Updated.
* src/cff/cffobjs.c (cff_face_init): Minor.
2019-06-10 23:09:49 -04:00
Werner Lemberg
7b84104720
Various clang 8.0 static analyzer fixes.
...
Reported by Sender Ghost <lightside@gmx.com>.
* src/autofit/afcjk.c (af_cjk_hints_compute_edges): Catch a corner
case where `edge->first' could be NULL.
* src/pfr/pfrobjs.c (pfr_slot_load): Remove unnecessary test of
`size'.
* src/raster/ftraster.c (Draw_Sweep): Catch a corner case where
`draw_right' might be NULL.
* src/sfnt/ttmtx.c (tt_face_get_metrics): Fix limit test for
`aadvance'.
Ensure `abearing' always hold a meaningful result.
* src/truetype/ttgload.c (load_truetype_glyph): Ensure `subglyph' is
not NULL before accessing it.
* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Remove unnecessary
test of `namedstyle'.
* src/type42/t42parse.c (t42_parser_done): Ensure
`parser->root.funcs.done' is not NULL before accessing it.
2019-05-04 08:13:22 +02:00
Werner Lemberg
7585997024
Update all copyright notices.
2019-02-23 10:07:09 +01:00
Werner Lemberg
f686ad46a3
Update copyright years.
2019-01-22 20:31:44 +01:00
Werner Lemberg
a0dd16fb3d
Don't use `trace_' prefix for FT_COMPONENT arguments.
...
* include/freetype/internal/ftdebug.h (FT_TRACE_COMP,
FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix.
(FT_TRACE): Use `FT_TRACE_COMP'.
*/* (FT_COMPONENT): Updated.
2018-08-15 18:13:17 +02:00
Werner Lemberg
50486df1e6
* src/type42/t42parse.c (t42_parse_sfnts): One more format check.
...
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9832
2018-08-13 08:46:53 +02:00
Werner Lemberg
cc3333902b
New base function `FT_Matrix_Check' ( #54019 ).
...
* src/base/ftcalc.c (FT_Matrix_Check): New base function to properly
reject degenerate font matrices.
* include/freetype/internal/ftcalc.h: Updated.
* src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c
(cid_parse_font_matrix), src/type1/t1load.c (t1_parse_font_matrix),
src/type42/t42parse.c (t42_parse_font_matrix): Use
`FT_Matrix_Check'.
2018-06-24 06:26:09 +02:00
Werner Lemberg
9ac9060df0
[GSoC] src/*.*: Convert block comments to `light' style.
...
This monster commit was created by applying Nikhil's scripts
`docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.
No change in functionality, of course.
I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git .
2018-06-03 09:08:41 +02:00
Werner Lemberg
0a0c22569d
Update copyright year.
2018-01-02 09:33:57 +01:00
Werner Lemberg
563ae78022
Update copyright year.
2017-01-04 20:16:34 +01:00
Werner Lemberg
37c72f66a5
Minor formatting.
2016-12-25 22:55:25 +01:00
Werner Lemberg
2ecf89b481
*/*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
2016-09-28 19:06:21 +02:00
Werner Lemberg
d28eac249a
[type42] Support `CharStrings' entry format as created by LilyPond.
...
* src/type42/t42parse.c (t42_parse_charstrings): Handle entries
having the format
(foo) cvn 12345 def
2016-05-30 00:23:59 +02:00
Werner Lemberg
9adeab6452
Update copyright year.
2016-01-13 11:54:10 +01:00
Werner Lemberg
e93d326c8b
[sfnt, type42] Fix clang compiler warnings.
...
* src/sfnt/sfobjs.c (sfnt_init_face): Initialize `offset'.
* src/type42/t42parse.c (t42_parse_sfnts): Use proper cast.
2015-10-22 10:17:20 +02:00
Werner Lemberg
87fefc594e
[type42] Fix heap buffer overflow ( #46269 ).
...
* src/type42/t42parse.c (t42_parse_sfnts): Fix off-by-one error in
bounds checking.
2015-10-21 20:29:12 +02:00
Werner Lemberg
649ca5562d
[type42] Better check invalid `sfnts' array data ( #46255 ).
...
* src/type42/t42parse.c (t42_parse_sfnts): Table lengths must be
checked individually against available data size.
2015-10-21 07:01:45 +02:00
Werner Lemberg
06c2d3324e
[type42] Protect against invalid number of glyphs ( #46159 ).
...
* src/type42/t42parse.c (t42_parse_charstrings): Check number of
`CharStrings' dictionary entries against size of data stream.
2015-10-08 21:31:57 +02:00
Werner Lemberg
f28c95c4a4
[type42] Fix memory leak ( #45989 ).
...
* src/type42/t42parse.c (t42_parse_charstrings): Allow only a single
`CharStrings' array.
2015-09-17 19:30:26 +02:00
Werner Lemberg
19cb1127d4
[type1, type42] Fix memory leaks ( #45966 ).
...
* src/type1/t1load.c (parse_blend_axis_types): Handle multiple axis
names.
(parse_blend_design_map): Allow only a single design map.
(parse_encoding): Handle multiple encoding vectors.
* src/type42/t42parse.c (t42_parse_encoding): Handle multiple
encoding vectors.
2015-09-15 08:52:36 +02:00
Werner Lemberg
581c7e2a51
[type1, type42] Check encoding array size ( #45961 ).
...
* src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2015-09-15 06:49:06 +02:00
Werner Lemberg
23423bc6f9
[type42] Fix endless loop ( #45920 ).
...
* src/type42/t42parse.c (t42_parse_encoding): Synchronize with
type1's `parse_encoding'.
2015-09-11 08:28:27 +02:00
Alexei Podtelezhnikov
a37da21a49
[type1,cid,type42] Minor improvements.
...
* src/type1/t1load.c (t1_parse_font_matrix): Scale units per EM only
when necessary. Refresh comments.
* src/cid/cidload.c (cid_parse_font_matrix): Ditto.
* src/type42/t42parse.c (t42_parse_font_matrix): Refresh comments.
2015-08-10 23:05:02 -04:00
Werner Lemberg
e5f4469359
[type42] Minor clean-up.
...
* src/type42/t42parse.c (t42_parse_font_matrix): Remove unused
variable.
2015-08-08 07:45:03 +02:00
Alexei Podtelezhnikov
fd70512eee
[type42] Parse FontMatrix according to specifications.
...
* src/type42/t42parse.c (t42_parse_font_matrix): Type 42 FontMatrix
does not need scaling by 1000. Units_per_EM are taken from the
embedded TrueType.
2015-08-06 21:49:08 -04:00
Alexei Podtelezhnikov
eabc8d72e0
[psaux,psnames,type1,type42] NULL.
2015-04-12 23:16:48 -04:00
Werner Lemberg
851e815127
Various compiler warning fixes for `make multi'.
...
* src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges),
src/autofit/aflatin.c (af_latin_hint_compute_blue_edges,
af_latin_hint_edges), src/autofit/aflatin2.c
(af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare
as `static'.
* src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH):
Removed. Unused.
* src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H.
* src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed. Unused.
* src/cff/cf2intrp.c: Include `cf2intrp.h'.
* src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused.
* src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused.
* src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'.
* src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX):
Removed. Unused.
* src/raster/ftraster.c (Render_Glyph): Declare as `static'.
* src/sfnt/ttpost.c (load_format_20): Fix signedness warning.
* src/truetype/ttdriver.c (PAIR_TAG): Removed. Unused.
* src/truetype/ttsubpix.c (is_member_of_family_class,
is_member_of_style_class): Declare as `static'.
* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare
as `static'.
* src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as
`static'.
(T1_FIELD_COUNT): Removed. Unused.
* src/type1/t1parse.h (T1_Done_Table): Removed. Unused.
* src/type42/t42parse.c (T1_Done_Table): Removed. Unused.
2015-03-01 19:27:09 +01:00
Werner Lemberg
7b6b417c97
[type42] Signedness fixes.
...
* src/type42/t42parse.c, src/type42/t42parse.h,
src/type42/t42types.h: Apply.
2015-02-21 10:39:34 +01:00
Werner Lemberg
6bd7d28fc7
Don't use `FT_PtrDist' for lengths.
...
Use FT_UInt instead.
* include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec,
T1_DecoderRec): Do it.
* include/internal/t1types.h (T1_FontRec): Ditto.
* src/cid/cidload.c (cid_parse_dict): Updated.
* src/pfr/pfrload.c (pfr_extra_item_load_font_id): Ditto.
* src/psaux/psobjs.c (ps_table_add), src/psaux/psobjs.h: Ditto.
* src/type1/t1load.c (parse_blend_axis_types, parse_encoding,
parse_chharstrings, parse_dict): Ditto.
* src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings,
t42_parse_dict): Ditto.
2015-02-18 09:22:06 +01:00
Werner Lemberg
f57fc59e01
Run `src/tools/update-copyright'.
2015-01-17 20:41:43 +01:00
Werner Lemberg
812ed34189
* src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size.
2014-12-11 14:07:29 +01:00
Werner Lemberg
b94381134e
* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.
...
Problem reported by Dennis Felsing <dennis@felsin9.de>.
2014-12-11 13:33:14 +01:00
Werner Lemberg
b24e8ba28a
[Savannah bug #43682 ] Add/remove `void' casts to some functions.
...
We use a cast to indicate that we intentionally ignore a function's
return value. However, this doesn't apply to API functions where
errors can only happen for trivially invalid input.
* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2014-11-25 08:30:49 +01:00
Werner Lemberg
73be9f9ab6
[type1, type42] Another fix for Savannah bug #43655 .
...
* src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
(t42_parse_charstrings): Add another boundary testing.
2014-11-24 07:30:05 +01:00
Werner Lemberg
3788187e0c
[type42] Fix Savannah bug #43659 .
...
* src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'.
* src/type42/t42parse.c (t42_parse_sfnts): Always set
`face->ttf_size' directly. This ensures a correct stream size in
the call to `FT_Open_Face', which follows after parsing, even for
buggy input data.
Fix error messages.
2014-11-22 10:46:47 +01:00
Werner Lemberg
dd89710f0f
[type1, type42] Fix Savannah bug #43655 .
...
* src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
(t42_parse_charstrings): Fix boundary testing.
2014-11-21 22:19:28 +01:00
Werner Lemberg
8b281f83e8
Fix Savannah bug #41309 .
...
* src/type1/t1load.c (t1_parse_font_matrix): Properly handle result
of `T1_ToFixedArray'.
* src/cid/cidload.c (cid_parse_font_matrix): Synchronize with
`t1_parse_font_matrix'.
* src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with
`t1_parse_font_matrix'.
(t42_parse_encoding): Synchronize with `t1_parse_encoding'.
* src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>,
<T1_FIELD_TYPE_MMOX>: Properly handle result of `ps_tofixedarray'.
2014-01-23 08:14:53 +01:00
Werner Lemberg
e3c9301581
*/*: Use FT_Err_Ok only.
...
This is a purely mechanical conversion.
2013-03-14 11:21:17 +01:00
Werner Lemberg
059bc335ce
*/*: Use `FT_THROW'.
...
This is essentially a mechanical conversion, adding inclusion of
`FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
stand-alone compiling modes of the rasterizer modules.
To convert the remaining occurrences of FT_Err_XXX and friends it is
necessary to rewrite the code. Note, however, that it doesn't harm
if some cases are not handled since FT_THROW is a no-op.
2013-03-14 10:27:35 +01:00
Alexei Podtelezhnikov
79180ad049
[cid, type1, type42] Clean up units_per_EM calculations.
...
* src/cid/cidload.c (cid_parse_font_matrix): Updated.
* src/type1/t1load.c (t1_parse_font_matrix): Updated.
* src/type42/t42parse.c (t42_parse_font_matrix): Updated.
2012-11-27 21:36:20 -05:00
Alexei Podtelezhnikov
c18c1882c2
[type42] Minor code optimization (again).
...
* src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change.
2012-02-28 07:52:04 +01:00
Werner Lemberg
c42848e6d9
[type42] Minor code optimization.
...
* src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of
modulo operator.
2012-02-26 19:44:04 +01:00
Werner Lemberg
82365c0dea
[type42] Fix Savannah bug #35602 .
...
* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
thoroughly.
2012-02-25 13:22:40 +01:00
Werner Lemberg
70cf8c5e6d
Improve tracing.
...
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
Werner Lemberg
c06da1ad34
Fix Savannah bug #30656 .
...
* src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
string_size.
Fix comparison.
2010-08-05 23:15:26 +02:00
Werner Lemberg
370aea802c
Formatting.
2010-06-08 08:37:11 +02:00
Werner Lemberg
858abbedc0
For warning messages, replace FT_ERROR with FT_TRACE0.
...
FT_ERROR is now used only if a function produces a non-zero `error'
value.
Formatting, improving and harmonizing debug strings.
2009-06-26 06:15:41 +02:00
Werner Lemberg
b72af52b9c
Fix Savannah bug #26600 .
...
* src/type42/t42parse.c (t42_load_keyword): Handle
T1_FIELD_LOCATION_FONT_EXTRA.
2009-05-19 07:33:15 +02:00
Werner Lemberg
86e041b5a8
Remove redundant header inclusions.
...
This covers many Ghostscript Coverity issues.
* src/*: Do it.
2009-03-21 08:51:44 +01:00
Werner Lemberg
15b60bb513
Formatting, copyright years.
2009-03-03 21:35:32 +00:00