Commit Graph

284 Commits

Author SHA1 Message Date
Behdad Esfahbod aca378f51e Sanitize (Headless)ArrayOf()::len to ensure it doesn't use offsets 2017-10-31 18:11:10 -06:00
Behdad Esfahbod 5f04711314 Fix HeadlessArrayOf::sanitize_shallow() 2017-10-31 18:10:40 -06:00
Behdad Esfahbod af3f72f9eb Correctly mark NullPool const
Saves some more code size as well!
2017-10-27 15:14:44 -06:00
Behdad Esfahbod 3205de7906 Make the NullPool HB_INTERNAL shared
Saves 2k of .bss section.
2017-10-27 15:01:40 -06:00
Behdad Esfahbod 4a27c17ea0 Fix IntType.cmp() to avoid narrowing down integer types
Fixes https://github.com/behdad/harfbuzz/issues/571
2017-10-27 14:29:12 -06:00
Behdad Esfahbod d6f612fac8 [bsearch] Micro-optimization 2017-10-17 16:32:12 -07:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod c3448e8d21 Use static_assert instead of custom ASSERT_STATIC 2017-10-15 12:02:00 +02:00
Behdad Esfahbod b732c53eb5 Add LArrayOf<> 2017-01-22 20:31:53 -08:00
Behdad Esfahbod 5e156fa5ed Add LOffsetTo<> 2017-01-22 20:28:56 -08:00
Behdad Esfahbod 784d1180de Fix build with clang 2017-01-11 11:58:13 -08:00
Behdad Esfahbod 1f810daf16 Port math table to hb_lazy_table_loader_t 2017-01-09 23:50:56 -08:00
Behdad Esfahbod ebbcc11122 Add hb_lazy_table_loader_t 2017-01-09 22:47:47 -08:00
Behdad Esfahbod 1af9d924a4 Move lazy-loader to more generic place 2017-01-09 22:22:37 -08:00
nvelinov 7d1c5d8281 Compilation Error for ASSERT_STATIC on Some Compilers (#380)
* this pointer in type definitions is not interpreted as a constant.
This rule is not enforced strictly by all compilers, but the Green Hills Software compiler will regard this as an error.

* Merging branches for the DEFINE_SIZE_UNION macro
Adding check for the existence of static_size field in the tested member.
2016-12-23 19:46:37 -06:00
Behdad Esfahbod a7edeb6f02 Make OffsetArrayOf take OffsetType template argument 2016-12-16 19:06:26 -06:00
Behdad Esfahbod 8dddc231cf [GX] Revert "[GX] Add VariationAlternates, to allow conditional lookups in GSUB/GPOS"
This reverts commit 2859f1c7174d6f7ae5dcf0db5411bc0182b21594.
We are going in a different direction.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod baa329c6a1 [GX] Add compact VariationDevice implementation
Add compact format that uses signed bytes instead of shorts.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 71b06fd392 [GX] Add VariationAlternates, to allow conditional lookups in GSUB/GPOS
Not hooked up to runtime yet.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 70eb2ff682 Check for offset overflows during sanitize 2016-12-02 19:51:23 -08:00
Behdad Esfahbod b92ba7bafc [CBDT] Use CHAR instead of int8_t 2016-12-02 15:21:43 -08:00
Behdad Esfahbod 587d46227a [ot-font] Start implementing 'post' table, for accessing glyph names 2016-04-30 19:20:56 +02:00
Behdad Esfahbod 6dd80faf0d Fix FixedVersion::to_int()
Ouch.  Had broken it in 9a13ed453e

Fixes https://github.com/behdad/harfbuzz/issues/238
Will add test soon.
2016-04-04 14:34:25 -07:00
Behdad Esfahbod 68b6296d33 Add F2DOT14 type 2016-03-01 16:41:53 +09:00
Behdad Esfahbod 9a13ed453e Make FixedVersion a template 2016-02-22 15:38:44 +09:00
Behdad Esfahbod 53c47c8582 Increase sanitize edit count from 8 to 32
See previous commit.
2016-01-05 13:26:20 +00:00
Steven R. Loomis a13b023dbf AIX fixes
- use '-w' instead of '\<...\>' for check-header-guards
  grep manpage says these are the same

- put '-q' first in the grep options

- move VAR into hb-private.hh

- hb-font-private.hh - use [VAR] instead of [] for variable array
2015-12-12 17:44:44 -08:00
Behdad Esfahbod 14c2de3218 Limit max edits during sanitize to 8
Used to be 100.  If a tabe needs more than one or two edits, it's
probably completely bogus...

Might help with speeding up fuzzing for
https://github.com/behdad/harfbuzz/issues/157
2015-11-04 18:00:57 -08:00
Behdad Esfahbod ce889189c1 Fix two more -Wshadow warnings
https://bugzilla.mozilla.org/show_bug.cgi?id=1215894
2015-10-21 11:23:12 -02:00
Behdad Esfahbod ee9b0b6cb5 Fix another sanitize bug
Also discovered by "libFuzzer".
2015-10-09 14:23:15 -04:00
Behdad Esfahbod f396fbb000 Fix return value of sanitize when subformat is not readable
This is a fix on top of the previous issue fixed in
c917965b9e.

This was caught by "libFuzzer" testing.
2015-10-09 12:25:55 -04:00
Behdad Esfahbod 77a1a2bc18 Add hb_dispatch_context_t 2015-10-09 12:20:58 -04:00
Behdad Esfahbod b47159011c Define return_trace()
Not functional change (expected!).
2015-09-29 14:57:02 +01:00
Behdad Esfahbod 0299b45000 Make BYTE a real type 2015-08-21 12:44:36 +01:00
Behdad Esfahbod 5175300fba [layout] Fix comparison of GlyphID and hb_codepoint_t
Before, the IntType::cmp functions providing this and was truncating
the hb_codepoint_t to 16bits before comparison.  I have no idea how
this was never discovered, and I'm too lazy to try to reproduce this
with Pango (which uses non-16bit codepoint numbers for missing glyphs).
2015-02-25 15:43:34 -08:00
Behdad Esfahbod 7cce809cb1 Remove unused (and wrong as of a few commits ago) cmp() function 2015-02-25 15:43:34 -08:00
Behdad Esfahbod bbdd6fd21c Minor simpilfy BEInt 2015-02-25 15:43:32 -08:00
Behdad Esfahbod 88a399acdc Optimize IntType comparison to avoid branches for 16bit numbers 2015-02-25 15:43:32 -08:00
Behdad Esfahbod 37de2d5331 Minor simplify IntType 2015-02-25 15:43:31 -08:00
Behdad Esfahbod 095a1257cc [layout] Port sanitize() to use dispatch()
Needed some rework of Extension table.  Hopefully I got it right, and
the new template usage doesn't break any compilers...
2015-02-25 15:43:30 -08:00
Behdad Esfahbod de2118ed7a Make sanitize() a const method
This makes a lot of code safer.  We only try modifying the object in one
place, after making sure it's safe to do so.  So, do a const_cast<> in
that one place...
2015-02-25 15:43:28 -08:00
Behdad Esfahbod d5a5052098 Assert that blob length doesn't overflow address.
This will crash now, if blob was created with wrong length.
Check for that coming next commit.
2014-12-18 18:09:41 -08:00
Behdad Esfahbod 282b13f9b4 [sanitize] Improve debug output some more 2014-12-12 19:34:49 -08:00
Behdad Esfahbod 0766ee1f4e [sanitize] Improve debug output 2014-12-12 18:23:20 -08:00
Behdad Esfahbod 5a5640d850 Move code around 2014-10-14 21:26:13 -07:00
Behdad Esfahbod 666b42f73b Move macros around
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84491
2014-10-14 21:24:59 -07:00
Behdad Esfahbod 7e8c389546 Minor warnings fixes
Some systems insist on -Wmissing-field-initializers.  We have too many,
by design.  Fix a few easy ones.
2014-07-25 11:23:17 -04:00
Behdad Esfahbod 7627100f42 Mark unsigned integer literals with the u suffix
Simplifies hb_in_range() calls as the type can be inferred.
The rest is obsessiveness, I admit.
2014-07-11 16:22:13 -04:00
Behdad Esfahbod 586b60622c Minor: final bits of cleanup 2014-06-27 15:39:47 -04:00
Behdad Esfahbod 51d9ba09bc Minor 2014-06-27 15:27:15 -04:00