[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Sat Jul 4 09:09:19 PDT 2015


 vcl/source/gdi/pdfwriter_impl.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8ce6e3135f841f8213e35ce136e98c33007fe5e6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 4 17:01:33 2015 +0100

    a high surrogate can result in an empty output string from a non-empty input
    
    Change-Id: Id544bdf639151ff3d9a164c52977acc6022cede9

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 54adf29..70a1502 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;
                     }
                 }
             }


More information about the Libreoffice-commits mailing list