summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/ios/source/gdi/salcoretextlayout.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/ios/source/gdi/salcoretextlayout.cxx b/vcl/ios/source/gdi/salcoretextlayout.cxx
index 99151e886b0f..ff6552fed27a 100644
--- a/vcl/ios/source/gdi/salcoretextlayout.cxx
+++ b/vcl/ios/source/gdi/salcoretextlayout.cxx
@@ -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 )