value it is later possible to check whether a specific
component value really belongs to a given ligature. */
- for ( i = 0; i < count - 1; i++ )
+ for ( i = 1; i < count; i++ )
{
while (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM(), lookup_flag, &property))
- _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH(), i, lig_id);
+ _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH(), i - 1, lig_id);
(buffer->in_pos)++;
}
bool ret = false;
+ if (HB_UNLIKELY (!buffer->in_length))
+ return false;
+
if (HB_LIKELY (!is_reverse ())) {
/* in/out forward substitution */
const LookupRecord *record = lookupRecord;
for (i = 0; i < count;)
{
- if ( record_count && i == record->sequenceIndex )
+ if (record_count && i == record->sequenceIndex)
{
unsigned int old_pos = buffer->in_pos;
DEFINE_ARRAY_TYPE (USHORT, value, (glyphCount ? glyphCount - 1 : 0));
inline bool apply (LOOKUP_ARGS_DEF, ContextLookupContext &context) const {
- const LookupRecord *record = (const LookupRecord *) ((const char *) value + sizeof (value[0]) * (glyphCount - 1));
+ const LookupRecord *record = (const LookupRecord *) ((const char *) value + sizeof (value[0]) * (glyphCount ? glyphCount - 1 : 0));
return context_lookup (LOOKUP_ARGS,
glyphCount,
recordCount,
USHORT startCoverageIndex; /* Coverage Index of first GlyphID in
* range */
};
-ASSERT_SIZE_DATA (CoverageRangeRecord, 6, "\001");
+ASSERT_SIZE_DATA (CoverageRangeRecord, 6, "\000\001");
struct CoverageFormat2 {
GlyphID end; /* Last GlyphID in the range */
USHORT classValue; /* Applied to all glyphs in the range */
};
-ASSERT_SIZE_DATA (ClassRangeRecord, 6, "\001");
+ASSERT_SIZE_DATA (ClassRangeRecord, 6, "\000\001");
struct ClassDefFormat2 {