summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Tygier <samtygier@yahoo.co.uk>2016-05-22 19:51:53 +0100
committerXisco FaulĂ­ <anistenis@gmail.com>2016-06-01 08:27:52 +0000
commit68ccab350ca5b907f185c729e94a14df15fedc23 (patch)
treeabe2b27f89262365ac68708ed88289f732744d22
parent5a728825e707c5a61c9236e6364d58472d2557db (diff)
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@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <anistenis@gmail.com>
-rw-r--r--svgio/source/svgreader/svgcharacternode.cxx5
1 files changed, 3 insertions, 2 deletions
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