[Libreoffice-commits] core.git: 2 commits - sw/source vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Thu May 1 10:23:56 PDT 2014
sw/source/core/crsr/crsrsh.cxx | 2 +-
vcl/source/outdev/font.cxx | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
New commits:
commit d0b3832bedf65d466b37a69036b0b4ba550a849b
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Fri May 2 03:03:37 2014 +1000
Fix 6b431b1f0d397067504b5300d49e10e232936836
Pushed wrong branch. Oops, sorry.
Change-Id: I592cf16c7af3c5e37a03eee79e5822dcc0b39225
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index c2d2639..9958ede 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2511,7 +2511,7 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing )
}
pTmpDel = 0;
}
- if( bGoNext && !bDelete )
+ if( bGoNext && !pTmp )
pTmp = (SwPaM*)pTmp->GetNext();
} while( !bGoNext || *ppDelRing != pTmp );
commit e97f19e96c094457ba98e3f89195cad4d814e8a3
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Fri May 2 02:34:14 2014 +1000
coverity#441827 Deference before null check
In OutputDevice::ImplGlyphFallbackLayout we should check to ensure that
mpFontEntry is valid, if not then return NULL early.
Change-Id: I946aa4d724a73a2ff85a4281c0df5f75e12104f7
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index e9ae02e..78f8204 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2029,6 +2029,16 @@ SalLayout* OutputDevice::getFallbackFont(ImplFontEntry &rFallbackFont,
SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLayoutArgs& rLayoutArgs ) const
{
+ // This function relies on a valid mpFontEntry, if it doesn't exist bail out
+ // - we'd have crashed later on anyway. At least here we can catch the error in debug
+ // mode.
+ if ( !mpFontEntry )
+ {
+ SAL_WARN ("vcl.gdi", "No font entry set in OutputDevice");
+ assert(mpFontEntry);
+ return NULL;
+ }
+
// prepare multi level glyph fallback
MultiSalLayout* pMultiSalLayout = NULL;
ImplLayoutRuns aLayoutRuns = rLayoutArgs.maRuns;
@@ -2062,7 +2072,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
aFontSelData.mpFontEntry = pFallbackFont;
aFontSelData.mpFontData = pFallbackFont->maFontSelData.mpFontData;
- if( mpFontEntry && nFallbackLevel < MAX_FALLBACK-1)
+ if( nFallbackLevel < MAX_FALLBACK-1)
{
// ignore fallback font if it is the same as the original font
if( mpFontEntry->maFontSelData.mpFontData == aFontSelData.mpFontData )
More information about the Libreoffice-commits
mailing list