From 68ccab350ca5b907f185c729e94a14df15fedc23 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sun, 22 May 2016 19:51:53 +0100 Subject: tdf#99994 Avoid invalid access by reusing getFontFamily() result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Xisco FaulĂ­ --- svgio/source/svgreader/svgcharacternode.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'svgio/source/svgreader') diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index 1753f2dd4c6c..254919025056 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -236,9 +236,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 -- cgit