ubsan: load of value 768, which is not a valid value for type

Change-Id: Ief0b70f19630d8d8cc925145848c7a2c8a2813ad
This commit is contained in:
Caolán McNamara
2016-03-16 10:24:40 +00:00
parent c9be863a12
commit eca17faebd

View File

@@ -338,7 +338,9 @@ void LwpSpacingCommonOverride::Read(LwpObjectStream* pStrm)
if (pStrm->QuickReadBool())
{
ReadCommon(pStrm);
m_nSpacingType = static_cast<SpacingType>(pStrm->QuickReaduInt16());
const sal_uInt16 nSpacingType = pStrm->QuickReaduInt16();
//only the bottom pair of bits matter
m_nSpacingType = static_cast<SpacingType>(nSpacingType & 0x3);
m_nAmount = pStrm->QuickReadInt32();
m_nMultiple = pStrm->QuickReadInt32();
}