mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
In OT::VarData::Serialize don't attempt to serialize an empty set of rows.
Protects against incorrectly accessing rows[0] when rows is empty.
This commit is contained in:
parent
6dff699f3f
commit
b1a0a4c228
1 changed files with 6 additions and 1 deletions
|
@ -2863,8 +2863,13 @@ struct VarData
|
|||
const hb_vector_t<const hb_vector_t<int>*>& rows)
|
||||
{
|
||||
TRACE_SERIALIZE (this);
|
||||
if (unlikely (!c->extend_min (this))) return_trace (false);
|
||||
unsigned row_count = rows.length;
|
||||
if (!row_count) {
|
||||
// Nothing to serialize, will be empty.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (unlikely (!c->extend_min (this))) return_trace (false);
|
||||
itemCount = row_count;
|
||||
|
||||
int min_threshold = has_long ? -65536 : -128;
|
||||
|
|
Loading…
Add table
Reference in a new issue