Kaydet (Commit) 40d663ad authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz+ubsan: downcast does not point to SwTextFormatColl

sw/source/filter/ww8/ww8par.cxx:1654:20: runtime error: downcast of address 0x000012e4a730 which does not point to an object of type 'const SwTextFormatColl'
0x000012e4a730: note: object is of type 'SwCharFormat'

Change-Id: Idc44902b0602af13fbc021c8f40a0c0dca0e46b3
Reviewed-on: https://gerrit.libreoffice.org/43514Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e8b5510a
...@@ -1645,19 +1645,19 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) ...@@ -1645,19 +1645,19 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
SvxTabStopItem aAttr(0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP); SvxTabStopItem aAttr(0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP);
const SwTextFormatColl* pSty = nullptr; const SwFormat * pSty = nullptr;
sal_uInt16 nTabBase; sal_uInt16 nTabBase;
if (m_pAktColl && m_nAktColl < m_vColl.size()) // StyleDef if (m_pAktColl && m_nAktColl < m_vColl.size()) // StyleDef
{ {
nTabBase = m_vColl[m_nAktColl].m_nBase; nTabBase = m_vColl[m_nAktColl].m_nBase;
if (nTabBase < m_vColl.size()) // Based On if (nTabBase < m_vColl.size()) // Based On
pSty = static_cast<const SwTextFormatColl*>(m_vColl[nTabBase].m_pFormat); pSty = m_vColl[nTabBase].m_pFormat;
} }
else else
{ // Text { // Text
nTabBase = m_nAktColl; nTabBase = m_nAktColl;
if (m_nAktColl < m_vColl.size()) if (m_nAktColl < m_vColl.size())
pSty = static_cast<const SwTextFormatColl*>(m_vColl[m_nAktColl].m_pFormat); pSty = m_vColl[m_nAktColl].m_pFormat;
//TODO: figure out else here //TODO: figure out else here
} }
...@@ -1687,7 +1687,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) ...@@ -1687,7 +1687,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
// current one (prevent loop) // current one (prevent loop)
aLoopWatch.insert(reinterpret_cast<size_t>(pSty)); aLoopWatch.insert(reinterpret_cast<size_t>(pSty));
if (nTabBase < m_vColl.size()) if (nTabBase < m_vColl.size())
pSty = static_cast<const SwTextFormatColl*>(m_vColl[nTabBase].m_pFormat); pSty = m_vColl[nTabBase].m_pFormat;
//TODO figure out the else branch //TODO figure out the else branch
if (aLoopWatch.find(reinterpret_cast<size_t>(pSty)) != if (aLoopWatch.find(reinterpret_cast<size_t>(pSty)) !=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment