[ubsan] Don't decrease pointer if match_glyph_data is null (#2048)

Similar to fix on https://github.com/harfbuzz/harfbuzz/pull/2022

Fixes https://crbug.com/1023070
This commit is contained in:
Ebrahim Byagowi 2019-11-09 12:25:33 +03:30 committed by GitHub
parent 878e3588a3
commit 64a45be519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -363,7 +363,11 @@ struct hb_ot_apply_context_t :
matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
}
void reject () { num_items++; match_glyph_data--; }
void reject ()
{
num_items++;
if (match_glyph_data) match_glyph_data--;
}
matcher_t::may_skip_t
may_skip (const hb_glyph_info_t &info) const