[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qa vcl/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Fri Mar 24 11:25:03 UTC 2017
vcl/inc/unx/glyphcache.hxx | 4 ++--
vcl/source/gdi/svmconverter.cxx | 6 +++++-
vcl/unx/generic/gdi/cairotextrender.cxx | 2 +-
vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 4 ++--
4 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit d776eeab752fd313226a7570c3ed4d8e964b4406
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 24 10:46:31 2017 +0000
ofz#937 sanity check claimed record length
Change-Id: Ic0b9b23764bd7533adbc746419d38da8ab7ce704
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-1.svm
similarity index 100%
rename from vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-1.svm
rename to vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-1.svm
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-2.svm
similarity index 100%
rename from vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-2.svm
rename to vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-2.svm
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm b/vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-3.svm
similarity index 100%
rename from vcl/qa/cppunit/graphicfilter/data/svm/pass/mapmode-3.svm
rename to vcl/qa/cppunit/graphicfilter/data/svm/fail/mapmode-3.svm
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 9c56e6edf487..cb0f87ac387e 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -1024,7 +1024,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry.get(), nIndex, nLen ) );
}
- rIStm.Seek( nActBegin + nActionSize );
+
+ if (nActionSize < 24)
+ rIStm.SetError(SVSTREAM_FILEFORMAT_ERROR);
+ else
+ rIStm.Seek(nActBegin + nActionSize);
}
break;
commit 27bcd3137e522e1e5c507a4c754a448f8fe08846
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 23 21:25:44 2017 +0000
shared_ptr->unique_ptr
Change-Id: I89aa885c2d5a5c1150ac83b515c0bb84ff2ce039
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 4e31a7189744..4c0ce0d2695a 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -123,7 +123,7 @@ public:
bool TestFont() const { return mbFaceOk;}
FT_Face GetFtFace() const;
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
- const std::shared_ptr<FontConfigFontOptions>& GetFontOptions() const;
+ const FontConfigFontOptions* GetFontOptions() const;
bool NeedsArtificialBold() const { return mbArtBold; }
bool NeedsArtificialItalic() const { return mbArtItalic; }
@@ -182,7 +182,7 @@ private:
FT_FaceRec_* maFaceFT;
FT_SizeRec_* maSizeFT;
- mutable std::shared_ptr<FontConfigFontOptions> mxFontOptions;
+ mutable std::unique_ptr<FontConfigFontOptions> mxFontOptions;
bool mbFaceOk;
bool mbArtItalic;
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 842a6b643ed7..11cedcc66701 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -229,7 +229,7 @@ void CairoTextRender::DrawTextLayout(const CommonSalLayout& rLayout)
FT_Face aFace = rFont.GetFtFace();
CairoFontsCache::CacheId aId;
aId.maFace = aFace;
- aId.mpOptions = rFont.GetFontOptions().get();
+ aId.mpOptions = rFont.GetFontOptions();
aId.mbEmbolden = rFont.NeedsArtificialBold();
cairo_matrix_t m;
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 903f560e1a55..0737d2bdf3d1 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -466,14 +466,14 @@ namespace
}
}
-const std::shared_ptr<FontConfigFontOptions>& FreetypeFont::GetFontOptions() const
+const FontConfigFontOptions* FreetypeFont::GetFontOptions() const
{
if (!mxFontOptions)
{
mxFontOptions.reset(GetFCFontOptions(mpFontInfo->GetFontAttributes(), maFontSelData.mnHeight));
mxFontOptions->SyncPattern(GetFontFileName(), GetFontFaceIndex(), NeedsArtificialBold());
}
- return mxFontOptions;
+ return mxFontOptions.get();
}
const OString& FreetypeFont::GetFontFileName() const
More information about the Libreoffice-commits
mailing list