Commit Graph
158 Commits
Author SHA1 Message Date
Behdad Esfahbod 3a9262cc3d [sanitize] More hb_barrier() annotations 2023-11-04 15:21:47 -06:00
Garret Rieger 52bc78e70d s/PairPos/MarkBasePos/ in MarkBasePos repacking implementation. 2023-10-16 12:25:25 -06:00
Qunxin Liu 1f395cbaf9 [instancer] templatize the priority queue, use custom type for varstore
when instantiating varstore, we need to pop a tuple like
(combined_gain, i, j), if combined gain is the same then we compare the
value of i, and then j. So we'd like to use custom type as the key when
popping from the queue. This would match fonttool's algorithm cause it
uses heappop().
2023-10-13 14:52:27 -06:00
Vincent Torri 17ee3cd7f4 fix warning with unsigned long 2023-09-10 11:34:30 +03:00
Garret Rieger a1f034eaac [repacker] fix fuzzer failure.
Fixes: https://oss-fuzz.com/testcase-detail/6490945267564544
2023-08-28 23:17:13 -04:00
Garret Rieger c28fdc39b2 [repacker] fix bot failure. 2023-08-23 17:03:54 -06:00
Garret Rieger 5587247d5b [repacker] create only one extension subtable per physical subtable.
During extension promotion when multiple lookups refer to a shared subtable node create and reuse a single extension subtable for it. Fixes: https://github.com/fonttools/fonttools/issues/3260.
2023-08-23 17:03:54 -06:00
Garret Rieger ca906e8747 [repacker] fix fuzzer timeout.
Corrects some mistakes in the handling of incoming_edges_ when memory allocation failures happen.
2023-08-17 12:01:44 -06:00
Behdad Esfahbod 91c449a64a [graph] Make space_for non-recursive
It was tail-recursive so perhaps the compiler did the same.
Anyway, make it explicit now.
2023-08-02 14:40:55 -06:00
Behdad Esfahbod 70b3fbed28 [graph] Fix invalid read when map gets resized
I don't fully understand how the old code was wrong, since
*v should be evaluated before the set() method call.
Yet this seems to fix a bug that could be reproduced
with HB_DEBUG_SUBSET_REPACK enabled and the following:

$ hb-repacker-fuzzer test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-6419865171525632
2023-08-01 15:16:16 -06:00
Behdad Esfahbod 94d4283b12 [graph] Handle a malloc fail
Fixes https://oss-fuzz.com/testcase-detail/4579249263345664
2023-08-01 15:06:01 -06:00
Behdad Esfahbod 603920e911 [graph] Minor asserts 2023-08-01 14:58:33 -06:00
Behdad Esfahbod 8d00476fbf [graph] Minor restructure a condition 2023-08-01 14:27:37 -06:00
Behdad Esfahbod 7946984b96 [graph] More assert 2023-08-01 14:18:03 -06:00
Behdad Esfahbod 3b386c3773 [graph] Minor assert 2023-08-01 14:15:41 -06:00
Behdad Esfahbod 07e7033076 [graph] Error check 2023-08-01 12:25:45 -06:00
Behdad Esfahbod 7a9aac1ae3 [graph] Fixes to parent handling 2023-08-01 12:17:13 -06:00
Behdad Esfahbod 23838e5a2e [graph] Error handling 2023-07-29 13:20:14 -06:00
Behdad Esfahbod 04f4909257 [graph] Use a move instead of swap 2023-07-28 14:37:52 -06:00
Behdad Esfahbod 3bedb0eeed [graph] Minor rename 2023-07-27 16:04:01 -06:00
Behdad Esfahbod bb1f53c254 [graph] Try fixing infinite loop found by CIFuzz under malloc fail 2023-07-27 13:29:56 -06:00
Behdad Esfahbod db3314c1f8 [graph] Minor space type change 2023-07-27 13:20:32 -06:00
Behdad Esfahbod 6bb61708ed [graph] Try fixing bots 2023-07-27 13:06:30 -06:00
Behdad Esfahbod 1b5abb1781 [graph] Speed-up vertices having only one parent 2023-07-27 12:56:06 -06:00
Behdad Esfahbod f3d0b11d57 [graph] Make parents private 2023-07-27 12:56:06 -06:00
Behdad Esfahbod d3b997ee70 [graph] Use a hb_map_t to keep parents, instead of hb_vector_t
In some fonts, for example Noto Duployan-Regular, nodes can
have over a thousand parents... Speeds up 10% subsetting.
2023-07-27 12:55:57 -06:00
Behdad Esfahbod 326d319f93 [graph] Micro-optimize 2023-07-15 13:14:34 -06:00
Behdad Esfahbod 548230e45e [graph] Early return from a function 2023-07-15 13:13:16 -06:00
Behdad Esfahbod 09706b04fc [graph] Add a pre-alloc to map 2023-07-15 13:11:04 -06:00
Behdad Esfahbod d1ddfc4d10 [graph] Use move instead of swap 2023-07-14 14:52:43 -06:00
Behdad Esfahbod 07cb6bf87a [graph] Minor, type 2023-07-14 13:38:33 -06:00
Behdad Esfahbod 867640af31 Revert "[set] Add test_and_add / test_and_del"
This reverts commit de1237fbf2.

This seems to be a net loss.
2023-07-14 13:09:16 -06:00
Behdad Esfahbod 10b776b0c3 [graph] Micro-optimize 2023-07-14 13:08:19 -06:00
Behdad Esfahbod de1237fbf2 [set] Add test_and_add / test_and_del
Use in graph.
2023-07-14 12:38:56 -06:00
Behdad Esfahbod 7f1ff9c881 [graph] Micro-optimize array access 2023-07-14 12:22:24 -06:00
Behdad Esfahbod 11308c4d1f [graph] Remove manual destruction
Happens automatically by destructor.
2023-06-08 14:51:18 -06:00
Behdad Esfahbod 67b1624727 [set] Simplify a few set iterations as range loop 2023-06-07 16:25:11 -06:00
Behdad Esfahbod ada1e9a924 [graph/serialize] Handle empty blob
Fixes https://oss-fuzz.com/testcase-detail/4877513265119232
2023-06-06 14:46:47 -06:00
Behdad Esfahbod ca27925d55 Use hb_codepoint_pair_t in more places 2023-06-03 16:18:15 -06:00
Garret Rieger ff326fbe8f [repacker] check the result of add_buffer() in other places where it's called. 2023-05-30 01:40:57 +02:00
Garret Rieger 20c564bc76 [repacker] Fix fuzzer memory leak.
https://oss-fuzz.com/testcase-detail/6419865171525632
2023-05-27 01:16:46 +02:00
Behdad Esfahbod 3c2a925b7f [graph] Micro-optimize 2023-05-08 10:16:50 -06:00
Behdad Esfahbod 3f9eb03b40 [graph] Micro-optimize 2023-05-01 12:55:29 -06:00
Garret Rieger b3fed4fa64 [repacker] fix fuzzer found memory leak.
Fixes https://oss-fuzz.com/testcase-detail/5196242811748352
2023-04-27 17:18:47 -06:00
Garret Rieger e4fff64ce3 [repacker] check duplicate() for success.
Fixes fuzzer testcase https://oss-fuzz.com/testcase-detail/5475787333828608.
2023-01-23 18:37:13 -07:00
Behdad Esfahbod ed023f66df Enable -Wformat-signedness
And fix the codebase.
2023-01-12 17:04:24 -07:00
Garret Rieger 35233d2514 [repacker] fix fuzzer reported stack overflow.
Fixes https://oss-fuzz.com/testcase-detail/6014493291577344.
2022-12-07 10:32:56 -07:00
Garret Rieger f1d3489388 [repacker] bail on failure to alloc assigned_bytes set.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448.
2022-12-05 14:13:47 -07:00
Garret Rieger 239a5aca02 [repacker] don't allow references to the null object in graph.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728
2022-12-05 14:13:47 -07:00
Behdad Esfahbod 2cdaedaf54 Use hb_enumerate in more places 2022-12-03 10:16:35 -07:00