mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 08:51:07 +01:00
[repacker] fix fuzzer reported stack overflow.
Fixes https://oss-fuzz.com/testcase-detail/6014493291577344.
This commit is contained in:
1 parent
b17fbc200b
commit
35233d2514
3 files changed
+13
No files matched your search
@@ -1187,6 +1187,11 @@ struct graph_t
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < vertices_.length; i++)
|
||||
// parents arrays must be accurate or downstream operations like cycle detection
|
||||
// and sorting won't work correctly.
|
||||
check_success (!vertices_[i].parents.in_error ());
|
||||
|
||||
parents_invalid = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -393,6 +393,14 @@ hb_resolve_overflows (const T& packed,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (sorted_graph.in_error ())
|
||||
{
|
||||
// Allocations failed somewhere
|
||||
DEBUG_MSG (SUBSET_REPACK, nullptr,
|
||||
"Graph is in error, likely due to a memory allocation error.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!hb_resolve_graph_overflows (table_tag, max_rounds, recalculate_extensions, sorted_graph))
|
||||
return nullptr;
|
||||
|
||||
|
||||
BIN
Binary file not shown.
Reference in new issue
Block a user