Commit Graph

4144 Commits

Author SHA1 Message Date
Bruce Mitchener 148ca61075 [ot-layout] Fix nullptr dereference.
If the `calloc` for `gsub_accels` or `gpos_accels` fails, then the
unlikely branch afterwards can be taken, which frees up the
`hb_ot_layout_t`, but since those fields can now be `nullptr`, then
we don't want to dereference them.
2018-01-31 08:05:25 -08:00
Bruce Mitchener 0c66043a92 [coretext] Fix memory leaks.
In `reference_table`, if the data is empty and we return early,
we still need to release the data object.

In `hb_coretext_shape`, there two edge cases where an early
return should release the attributed string.
2018-01-31 08:04:15 -08:00
Behdad Esfahbod e89df6e1ae [aat] Limit number of DontAdvance transitions
Remove the faulty loop-detection logic. Use max-ops for breaking
out of infinite loops or heavy work.

https://twitter.com/behdadesfahbod/status/958065026262183936
2018-01-30 11:01:18 -08:00
Ebrahim Byagowi 55cae0d72e
[test] Use 'otool -L' where ldd doesn't exist (macOS) (#732) 2018-01-29 18:05:24 +03:30
David Corbett 2ec7dd1f6c Fix Travis build on macOS (#731) 2018-01-29 02:18:28 +03:30
Behdad Esfahbod 12757b6929 Misc warning fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/712
2018-01-26 18:14:05 -08:00
bungeman 85be365ed9 Use KernSubTableFormat2::rightClassTable
Issue originally reported at http://cppfiles.com/chromium.txt .

This fixes what appears to be a copy - paste issue which causes both
KernSubTableFormat2::rightClassTable and the 'right' argument to
KernSubTableFormat2::get_kerning to go unused.
2018-01-26 15:20:18 -08:00
Bruce Mitchener 19a93fcf19 Fix typos. 2018-01-21 10:33:54 -08:00
Behdad Esfahbod 51ce3828e6 [aat] Fix Ligature matching
I hope... Makes "ffi" work with Zapfino. I'm not sure if doing it correctly though...
2018-01-19 18:37:58 -08:00
Behdad Esfahbod bef509855c [aat] Add TODO 2018-01-19 18:24:00 -08:00
Behdad Esfahbod e6f283ed7d [aat] Implement LigatureSubtable
We form the Zapfino ligature now. Yay! No further testing done.
2018-01-19 18:09:48 -08:00
Behdad Esfahbod f07ce661a2 [aat] Embed a sanitizer context in hb_aat_apply_context_t
For run-time checking.
2018-01-19 16:52:01 -08:00
Behdad Esfahbod 046690a4df [aat] Add hb_aat_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod fd03449094 Rename hb_apply_context_t to hb_ot_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod 94b49beee9 Whitespace 2018-01-19 16:40:13 -08:00
Cosimo Lupo c8f2a4f5b9 hb-common.cc: Hatran script is right-to-left (#714)
"Hatran is written from right to left horizontally"

http://www.unicode.org/L2/L2012/12312-n4324-hatran.pdf

This ancient script was added with Unicode 8.0.

Also this spreadsheet (referenced in an inline comment in the
source code) has it as RTL: http://goo.gl/x9ilM
2018-01-19 01:19:40 +03:30
Ebrahim Byagowi 00806149b9
Improve avoiding C++ linkage, definition creation and cmake tests (#710) 2018-01-19 01:12:31 +03:30
Behdad Esfahbod 461a605fde [aat] Allocate set dynamically 2018-01-17 10:02:48 -08:00
Behdad Esfahbod 949f6af289 Disallow sanitize recursing into Extension subtables multiple times
Fixes https://oss-fuzz.com/v2/testcase-detail/5216838347653120
which is a stack overflow, not by way of infinite recursion, just
being deep.  That's disallowed anyway, so catch it as it happens,
not afterwards.
2018-01-15 20:44:10 -05:00
Behdad Esfahbod bcb6f1ae0a Whitespace 2018-01-15 20:34:05 -05:00
Behdad Esfahbod 12fffce10e [aat] Sanitize classTable in StateTable 2018-01-15 15:41:51 -05:00
Behdad Esfahbod e6263c7142 [aat] Wire up table length to apply() 2018-01-15 15:37:55 -05:00
Behdad Esfahbod 679ae744d0 [aat] Towards implementing LigatureSubtable 2018-01-14 15:03:31 -05:00
Behdad Esfahbod c9e12a2b9b Fix set initializer 2018-01-13 17:05:12 +00:00
Behdad Esfahbod 9009b341c4 [aat] Fix some struct sizes
I hate it that with my compiler at least, it doesn't catch totally uncompilable
statements in templates if they are not used...
2018-01-12 12:04:53 +01:00
Behdad Esfahbod 57051b4f67 [aat] Flush rest of buffer if state machine failed 2018-01-12 11:42:25 +01:00
Behdad Esfahbod 25364c4f00 [aat] Fix symbol visibility
Not sure why only one of the bots sees this as visible...
2018-01-12 11:31:20 +01:00
Behdad Esfahbod ee16b9d8d3 Revert accidental morx enablement 2018-01-12 11:28:09 +01:00
Behdad Esfahbod cdfa801ff4 [aat] Tweak previous commit 2018-01-12 11:12:20 +01:00
Behdad Esfahbod f7600228a4 [aat] Detect infinite-loops in state machine 2018-01-12 11:09:21 +01:00
Behdad Esfahbod dd38db523a [aat] Fix more builds
Maybe I should disable C++11 detection such that my compiler also catches
these.  Doesn't look like we can switch to it for a while anyway...
2018-01-12 09:45:42 +01:00
Behdad Esfahbod 72cb2b1f57 [aat] Fix builds 2018-01-12 09:38:55 +01:00
Ting-Wei Lan e3a15d0c6d Update _POSIX_C_SOURCE to the latest version
Defining _POSIX_C_SOURCE to an old version on FreeBSD can cause C99 to
be disabled in libc.
2018-01-12 09:19:41 +01:00
Behdad Esfahbod c70d58f97d [aat] Port RearrangementSubtable to StateTableDriver 2018-01-12 00:08:22 +01:00
Behdad Esfahbod 117cfe7bb7 [aat] Add StateTableDriver and convert ContextualSubtable to it 2018-01-12 00:01:36 +01:00
Behdad Esfahbod 1f1c85a54a [aat] Remove 'mort' support
It's dead, Jim!
2018-01-11 22:43:57 +01:00
Behdad Esfahbod 7e2fed6d73 [aat] Allow DontAdvance
Apparently CoreText does allow these.  To be done: detect infinite
loops.

Fixes MORX-12 test.
2018-01-11 19:25:21 +01:00
Behdad Esfahbod 17f01aff91 [aat] Sanitize ContextualSubtable 2018-01-11 18:54:49 +01:00
Behdad Esfahbod 9b82aa19d8 More warning fixes 2018-01-11 18:19:42 +01:00
Behdad Esfahbod 680cbc2eb3 [aat] Sanitize StateTable 2018-01-11 18:15:53 +01:00
Behdad Esfahbod 0e3b3379a0 [aat] Actually fix d887f93148 2018-01-11 18:01:10 +01:00
Behdad Esfahbod 3f291ffd5a [buffer] Fix compiler warnings
line 323: Warning: info hides hb_buffer_t::info
...
2018-01-11 17:57:46 +01:00
Behdad Esfahbod d887f93148 [aat] Make bots happy
Don't know why this is not caught by my compiler.  Looks like clang catches it
while gcc doesn't.

In file included from ../src/hb-aat-layout-morx-table.hh:31:
../src/hb-aat-layout-common-private.hh:523:30: error: no member named 'static_size' in 'AAT::ContextualSubtable<AAT::MorxTypes>::EntryData'
  DEFINE_SIZE_STATIC (4 + T::static_size);
                            ~~~^
2018-01-11 17:41:34 +01:00
Behdad Esfahbod f6be730994 [aat] In NoncontextualSubtable, handle MarkLast with end-of-line transition
Fixes MORX-11 test.
2018-01-11 15:23:24 +01:00
Behdad Esfahbod f9be673814 [aat] Implement ContextualSubtable
Tested with Zapfino and text "2nd". Sascha will create tests later.
2018-01-11 15:15:36 +01:00
Behdad Esfahbod 335a9c1fe4 [aat] Towards implementing ContextualSubtable 2018-01-11 15:15:36 +01:00
Behdad Esfahbod 62348f647f [aat] Implement end-of-text in state machine
Passes MORX-10 test now.
2018-01-11 15:15:36 +01:00
Behdad Esfahbod 9adbd938fa Minor 2018-01-11 15:15:36 +01:00
Behdad Esfahbod 94644d7ea4 [aat] Generate finegrained unsafe-to-break in state-machine!
Neato.
2018-01-11 11:49:07 +01:00
Behdad Esfahbod 994eb7744c [buffer] Fix crash 2018-01-11 11:37:12 +01:00