mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[buffer] Buffer start <= end <= len requirement in (de-)serialize
This commit is contained in:
parent
3b64122a7f
commit
8f5d8b155c
1 changed files with 4 additions and 2 deletions
|
@ -464,7 +464,8 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
|
|||
hb_buffer_serialize_format_t format,
|
||||
hb_buffer_serialize_flags_t flags)
|
||||
{
|
||||
assert (start <= end && end <= buffer->len);
|
||||
end = hb_clamp (end, start, buffer->len);
|
||||
start = hb_min (start, end);
|
||||
|
||||
unsigned int sconsumed;
|
||||
if (!buf_consumed)
|
||||
|
@ -561,7 +562,8 @@ hb_buffer_serialize_unicode (hb_buffer_t *buffer,
|
|||
hb_buffer_serialize_format_t format,
|
||||
hb_buffer_serialize_flags_t flags)
|
||||
{
|
||||
assert (start <= end && end <= buffer->len);
|
||||
end = hb_clamp (end, start, buffer->len);
|
||||
start = hb_min (start, end);
|
||||
|
||||
unsigned int sconsumed;
|
||||
if (!buf_consumed)
|
||||
|
|
Loading…
Add table
Reference in a new issue