Kaydet (Commit) 68ccab35 authored tarafından Sam Tygier's avatar Sam Tygier Kaydeden (comit) Xisco Faulí

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/25704Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarXisco Faulí <anistenis@gmail.com>
üst 5a728825
...@@ -236,9 +236,10 @@ namespace svgio ...@@ -236,9 +236,10 @@ namespace svgio
if(nLength) if(nLength)
{ {
// prepare FontAttribute // prepare FontAttribute
OUString aFontFamily = rSvgStyleAttributes.getFontFamily().empty() ? const SvgStringVector& rFontFamilyVector = rSvgStyleAttributes.getFontFamily();
OUString aFontFamily = rFontFamilyVector.empty() ?
OUString("Times New Roman") : OUString("Times New Roman") :
rSvgStyleAttributes.getFontFamily()[0]; rFontFamilyVector[0];
// #i122324# if the FontFamily name ends on ' embedded' it is probably a re-import // #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 // of a SVG export with font embedding. Remove this to make font matching work. This
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment