Commit Graph
151 Commits
Author SHA1 Message Date
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
Garret Rieger de5a621322 [repacker] enforce root node having no incoming edges. 2022-12-01 23:37:16 +00:00
Garret Rieger 30e405e470 [repacker] ensure link obj indices are valid. 2022-12-01 22:12:59 +00:00
Garret Rieger 554ed06fac [repacker] add cycle detection to the graph sort.
This allows us to bail early if the graph is not acyclic.
2022-12-01 21:52:37 +00:00
Garret Rieger 9e99d08470 [repacker] validate link widths during repacker setup. 2022-12-01 20:17:41 +00:00
Garret Rieger edf7a29595 [repacker] Validate link positions before running the repacker. 2022-12-01 20:17:41 +00:00
Garret Rieger deca30b268 [repacker] get repacker fuzzer working.
Additionally add helper method that allows a graph to be saved as a fuzzer seed.
2022-12-01 20:17:40 +00:00
Garret Rieger 985b19f678 [repacker] begin implementing a fuzzer for the repacker api. 2022-12-01 20:17:39 +00:00