diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 5b1d9764e..9f4d7cb0b 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -369,7 +369,7 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font, unsigned int *caret_count /* IN/OUT */, hb_position_t *caret_array /* OUT */) { - unsigned int result_caret_count = 0; + unsigned int result_caret_count = caret_count ? *caret_count : 0; unsigned int result = font->face->table.GDEF->table->get_lig_carets (font, direction, glyph, start_offset, &result_caret_count, caret_array); if (result) {