Kaydet (Commit) 8951ef03 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Workaround for crash on iOS

Change-Id: I947f7def862d2a238dc609a91d898f03dbd72b84
üst 3cac4804
......@@ -421,6 +421,19 @@ bool CoreTextLayout::LayoutText(ImplLayoutArgs& args)
{
return false;
}
// If the string contains U+FFFD ("REPLACEMENT CHARACTER"), which
// happens at least for the ooo80484-1.slk document in
// sc_filters_test, the CTTypesetterCreateWithAttributedString()
// call below crashes, at least in the iOS simulator. Go figure.
// (In that case the string consists of *only* such characters,
// but play it safe.
for (int i = 0; i < m_chars_count; i++)
{
if (args.mpStr[args.mnMinCharPos+i] == 0xFFFD)
return false;
}
/* c0 and c1 are construction objects */
CFStringRef c0 = CFStringCreateWithCharactersNoCopy( NULL, &(args.mpStr[args.mnMinCharPos]), m_chars_count, kCFAllocatorNull );
if ( !c0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment