[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - svgio/source

Sam Tygier samtygier at yahoo.co.uk
Thu Jun 2 10:34:33 UTC 2016


 svgio/source/svgreader/svgcharacternode.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e687739eb4849014f7f2657e94d8ab67e4d74625
Author: Sam Tygier <samtygier at yahoo.co.uk>
Date:   Sun May 22 19:51:53 2016 +0100

    tdf#99994 Avoid invalid access by reusing getFontFamily() result
    
    getFontFamily() can give a different result on the second call so in
    order to protect against access to an invalid element of the vector
    the result must be reused.
    
    Change-Id: Iec7d58537263cb5c8a7c2ea95761dd929d659e01
    Reviewed-on: https://gerrit.libreoffice.org/25704
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Xisco Faulí <anistenis at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/25796
    Reviewed-by: Mark Page <aptitude at btconnect.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index 855beaa..8951c31 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -238,9 +238,10 @@ namespace svgio
             if(nLength)
             {
                 // prepare FontAttribute
-                OUString aFontFamily = rSvgStyleAttributes.getFontFamily().empty() ?
+                const SvgStringVector& rFontFamilyVector = rSvgStyleAttributes.getFontFamily();
+                OUString aFontFamily = rFontFamilyVector.empty() ?
                     OUString("Times New Roman") :
-                    rSvgStyleAttributes.getFontFamily()[0];
+                    rFontFamilyVector[0];
 
                 // #i122324# if the FontFamily name ends on ' embedded' it is probably a re-import
                 // of a SVG export with font embedding. Remove this to make font matching work. This


More information about the Libreoffice-commits mailing list