mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 00:41:09 +01:00
[VARC] Add consume_all to unpack_deltas()
Untested.
This commit is contained in:
1 parent
ae35e30bd2
commit
0dcdbb4f42
1 file changed
+6
-3
@@ -1861,15 +1861,18 @@ struct TupleVariationData
|
||||
|
||||
static bool unpack_deltas (const HBUINT8 *&p /* IN/OUT */,
|
||||
hb_vector_t<int> &deltas /* IN/OUT */,
|
||||
const HBUINT8 *end)
|
||||
const HBUINT8 *end,
|
||||
bool consume_all = false)
|
||||
{
|
||||
unsigned i = 0;
|
||||
unsigned count = deltas.length;
|
||||
unsigned count = consume_all ? UINT_MAX : deltas.length;
|
||||
while (i < count)
|
||||
{
|
||||
if (unlikely (p + 1 > end)) return false;
|
||||
if (unlikely (p + 1 > end)) return consume_all;
|
||||
unsigned control = *p++;
|
||||
unsigned run_count = (control & DELTA_RUN_COUNT_MASK) + 1;
|
||||
if (consume_all)
|
||||
deltas.resize (deltas.length + run_count, false);
|
||||
unsigned stop = i + run_count;
|
||||
if (unlikely (stop > count)) return false;
|
||||
if ((control & DELTAS_SIZE_MASK) == DELTAS_ARE_ZERO)
|
||||
|
||||
Reference in new issue
Block a user