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-11-17 19:19:30 +0100
commit0af4746b7f3c0640bef34b67b48c954886b459b1 (patch)
tree5a43d25ab92874ba9b5f165488a8da35623a336d /sw
parent76cc615ae6759837a093fee2c86b6e89bfb69bdf (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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123356 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 50602fed86b2b972d49d6c6366b2a3eb406e4ed4) Change-Id: I1739182a65f6738dad8623ec22950d797c59a6c7
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 a0b3e24c72dc..f46188f637cf 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -652,7 +652,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo
// Draw text next to the left border
Point aFontPos(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() )