summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-14 20:16:51 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-09-14 20:19:00 +0200
commit99cd15fa238886d23bdc429dc1133157d799487a (patch)
treedc91d4e8fac856a52bb938c2e55e9a7a3232ca19 /sw
parenta88b2d841856026ea1a0539d670e07fafd296c6e (diff)
avoid possible NULL dereference (fdo#82777)
Change-Id: Ifec915d5b2c9e5f7558e7850eb44e44300c9b374
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/trvlfrm.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index f53336511604..ce15334960a5 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2573,11 +2573,11 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr)
const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
const SwVirtFlyDrawObj* pObj = pFly->GetVirtDrawObj();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- SwPosition anchoredAt = *pAnchoredObj->GetFrmFmt().GetAnchor().GetCntntAnchor();
- bool inSelection = ( *pStartPos <= anchoredAt && anchoredAt < *pEndPos );
- if( anchoredAt == *pEndPos )
+ const SwPosition* anchoredAt = pAnchoredObj->GetFrmFmt().GetAnchor().GetCntntAnchor();
+ bool inSelection = ( anchoredAt != NULL && *pStartPos <= *anchoredAt && *anchoredAt < *pEndPos );
+ if( anchoredAt != NULL && *anchoredAt == *pEndPos )
{
- const SwNodes& nodes = anchoredAt.GetDoc()->GetNodes();
+ const SwNodes& nodes = anchoredAt->GetDoc()->GetNodes();
if( *pEndPos == SwPosition( nodes.GetEndOfContent()))
inSelection = true;
else