Commit Graph

24 Commits

Author SHA1 Message Date
Garret Rieger ec4321068b [subset] fix infinite loop caused by alloc failure in repacker.
Fixes: https://oss-fuzz.com/testcase-detail/5609112151916544.
2021-04-20 13:18:07 -06:00
Garret Rieger 0e845d973e [subset] fix memory leak in repacker caused by failed alloc.
Fixes: https://oss-fuzz.com/testcase-detail/5616763250278400.
2021-04-20 13:18:07 -06:00
Garret Rieger 71d6d15600 [subset] clamp distance to prevent shifting outside of the limits of int64.
Fixes https://oss-fuzz.com/testcase-detail/4961171477233664.
2021-04-06 11:48:39 -06:00
Garret Rieger c5c13006a1 [subset] fix memory leaks found in https://oss-fuzz.com/testcase-detail/5179935334465536 2021-03-31 12:37:45 -06:00
Garret Rieger 3827a3eb56 [subset] rename serializer::set_error() to err(). 2021-03-18 11:20:03 -07:00
Garret Rieger f561fa6e4c Change priority queue to use (priority, value) instead of (value, priority). 2021-03-18 11:13:47 -07:00
Garret Rieger b14475d2ae [subset] further changes to serializer error handling.
- Rename enum type and enum members.
- in_errors() now returns true for any error having been set. hb-subset now looks for offset overflow only errors to divert to repacker.
- Added INT_OVERFLOW and ARRAY_OVERFLOW enum values.
2021-03-18 10:51:26 -07:00
Garret Rieger 73ed59f7a6 [subset] store errors in the serializer as a flag set.
Make check_assign/check_equal specify the type of error to set.
2021-03-17 15:58:34 -07:00
Garret Rieger cf79fc342d [subset] limit priority bumps to 16. 2021-03-17 15:53:58 -07:00
Garret Rieger d3e2ba7c01 [subset] comment cleanup in hb-repacker.hh 2021-03-17 15:53:58 -07:00
Garret Rieger bb5c80a7c2 [subset] add error tracking to the repacker.
Also check for allocation failures as needed.
2021-03-17 15:53:58 -07:00
Garret Rieger 6e9468fcfb [subset] cleanup memory leaks in the repacker. 2021-03-17 15:53:58 -07:00
Garret Rieger a7a86a6eb4 [subset] Add prioritization offset resolution.
Vertices can now be prioritized to force them to sort closer to their parent. The resolver will attempt to use this for overflows on non-shared vertices.
2021-03-17 15:53:58 -07:00
Garret Rieger b452b2c76c [subset] refactor repacker graph to cache edge count and distances of vertices. 2021-03-17 15:53:57 -07:00
Garret Rieger 75414e82b5 [subset] Add table duplication overflow resolution. 2021-03-17 15:53:57 -07:00
Garret Rieger 8286bd8094 [subset] use vectors instead of hashmaps throughout the repacker since all keys will be mapped for these use cases. 2021-03-17 15:53:57 -07:00
Garret Rieger 519ae96617 [subset] switch sort_shortest_distance() to use priority queue. 2021-03-17 15:53:57 -07:00
Garret Rieger 5d3511e5b1 [subset] Change compute_distances() to use a priority queue. 2021-03-17 15:53:57 -07:00
Garret Rieger 4c8dd41ed9 [subset] re-write compute distances to use an array lookup for the distance map. 2021-03-17 15:53:57 -07:00
Garret Rieger aaa7873d42 [subset] add topological sort by closest distance via Dijkstra's algorithm. 2021-03-17 15:53:57 -07:00
Garret Rieger 8ebe5d734f Implement will_overflow (). 2021-03-17 15:53:57 -07:00
Garret Rieger f4c78cc7dd [subset] Implement Kahn's algo for topological sorting instead of BFS. 2021-03-17 15:53:57 -07:00
Garret Rieger 00f393dc3f [subset] finish up BFS sort implementation. 2021-03-17 15:53:57 -07:00
Garret Rieger 1584d3cb8f [subset] Start a proof of concept implementation of the GSUB/GPOS offset overflow resolver. 2021-03-17 15:53:57 -07:00