Ah, interesting. I should be more careful, reading API docs actually. Thanks for the patch, will push out with the next batch.
behdad On 10/28/2011 02:49 AM, Kenichi Ishibashi wrote: > Hi, > > hb_icu_unicode_decompose() uses ICU's u_strlen() to get the number of Unicode > codepoints in normalized buffer. However, it seems that it returns the number > of UChars in the buffer. UChar is equivalent to uint16_t. This means that we > can't get right number of codepoints when the buffer contains surrogate pairs. > This eventually causes infinite loop during decomposition. For example, if the > function is called like: > > hb_codepoint_t a, b; > hb_icu_unicode_decompose(0/*unused*/, 0x1f1ef /* REGIONAL INDICATOR SYMBOL > LETTER J */, &a, &b, 0/*unused*/); > > then, it returns TRUE with *a == 0x1f1ef. This leads infinite loop in > decompose(). Attached patch would fix the problem. > > Thanks, > > > > _______________________________________________ > HarfBuzz mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/harfbuzz _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
