summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-10-10 21:29:29 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-10-12 11:57:17 +0200
commit50602fed86b2b972d49d6c6366b2a3eb406e4ed4 (patch)
treeb76fbe26e3b800e85200926e4ad1d74f2d4cea19 /sw
parent40d70d427edddb589eda64fafc2e56536953d274 (diff)
Try to fix Ubsan TB
/sw/source/core/text/inftxt.cxx:651:37: runtime error: downcast of address 0x6060006542c0 which does not point to an object of type ´const SwTextPortion´ 0x6060006542c0: note: object is of type ´SwBookmarkPortion´ 3f 07 00 26 d0 ca 08 e3 2b 2b 00 00 2d 00 00 00 00 00 00 00 49 01 00 00 00 00 00 00 60 42 65 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for ´SwBookmarkPortion´ 0x2b2bda76d6b7 in SwTextPaintInfo::DrawText_(rtl::OUString const&, SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, o3tl::strong_int<int, Tag_TextFrameIndex>, bool, bool, bool, bool) /sw/source/core/text/inftxt.cxx:651:37 Taking a look at some other locations in the same file, it seems we need to test "rPor.InTextGrp()" to consider rPor as a SwTextPortion Change-Id: I1739182a65f6738dad8623ec22950d797c59a6c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123356 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/inftxt.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b22ed6efdbcb..d85df6397551 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -648,7 +648,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo
// Draw text next to the left border
Point aFontPos(m_aPos);
- if( m_pFnt->GetLeftBorder() && !static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithPrev() )
+ if( m_pFnt->GetLeftBorder() && rPor.InTextGrp() && !static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithPrev() )
{
const sal_uInt16 nLeftBorderSpace = m_pFnt->GetLeftBorderSpace();
if ( GetTextFrame()->IsRightToLeft() )