mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 07:21:06 +01:00
Add some missing checks for alloc failure in repacker.
This commit is contained in:
1 parent
15fe46ee28
commit
367657d74d
2 files changed
+10
-4
No files matched your search
+5
-3
@@ -1250,8 +1250,8 @@ struct graph_t
|
||||
vertices_[l.objidx].add_parent (clone_idx, true);
|
||||
}
|
||||
|
||||
check_success (!clone->obj.real_links.in_error ());
|
||||
check_success (!clone->obj.virtual_links.in_error ());
|
||||
if (unlikely (!check_success (!clone->obj.real_links.in_error ()))) return HB_GRAPH_INVALID;
|
||||
if (unlikely (!check_success (!clone->obj.virtual_links.in_error ()))) return HB_GRAPH_INVALID;
|
||||
|
||||
return clone_idx;
|
||||
}
|
||||
@@ -1721,7 +1721,9 @@ struct graph_t
|
||||
queue.insert (0, root_idx ());
|
||||
|
||||
hb_vector_t<bool> visited;
|
||||
visited.resize (vertices_.length);
|
||||
if (unlikely (!check_success (visited.resize (vertices_.length)))) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (!queue.in_error () && !queue.is_empty ())
|
||||
{
|
||||
|
||||
@@ -252,7 +252,11 @@ inline hb_blob_t* serialize (const graph_t& graph)
|
||||
|
||||
// Maps from our obj id's to the id's used during this serialization.
|
||||
hb_vector_t<unsigned> id_map;
|
||||
id_map.resize(graph.ordering_.length);
|
||||
if (!id_map.resize(graph.ordering_.length)) {
|
||||
DEBUG_MSG (SUBSET_REPACK, nullptr, "Unable to allocate id_map buffer.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (int pos = graph.ordering_.length - 1; pos >= 0; pos--) {
|
||||
unsigned i = graph.ordering_[pos];
|
||||
c.push ();
|
||||
|
||||
Reference in new issue
Block a user