summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/svparser.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 541aa5276c2d..cef258f04dd2 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -423,7 +423,8 @@ sal_uInt32 SvParser<T>::GetNextChar()
while( 0 == nChars && !bErr );
}
- if ( ! rtl::isUnicodeCodePoint( c ) )
+ // Note: ImplConvertUtf8ToUnicode() may produce a surrogate!
+ if (!rtl::isUnicodeCodePoint(c) || rtl::isHighSurrogate(c) || rtl::isLowSurrogate(c))
c = '?' ;
if( bErr )