summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-04 17:01:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-04 17:08:52 +0100
commit8ce6e3135f841f8213e35ce136e98c33007fe5e6 (patch)
tree8847b4cba89a655eb00dde9da1313567b2afe2b2 /vcl
parent2eea698f5b41b2dbf371e3a6c9d3b242c347206d (diff)
a high surrogate can result in an empty output string from a non-empty input
Change-Id: Id544bdf639151ff3d9a164c52977acc6022cede9
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 54adf2961380..70a150263f4b 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8590,7 +8590,7 @@ bool PDFWriterImpl::registerGlyphs( int nGlyphs,
else
{
OString aChar(&cChar, 1, RTL_TEXTENCODING_MS_1252);
- cChar = ((sal_Ucs)aChar[0]) & 0x00ff;
+ cChar = !aChar.isEmpty() ? (static_cast<sal_Ucs>(aChar[0]) & 0x00ff) : 0;
}
}
}