diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 7919f57d7c71..f70889dd2720 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4440,11 +4440,23 @@ void WW8RStyle::ImportOldFormatStyles() if (cb != 0xFF) { - sal_uInt8 stc2(0); - m_rStream.ReadUChar( stc2 ); - m_rStream.SeekRel(6); - nByteCount+=7; - sal_uInt8 nRemainder = cb-7; + sal_uInt8 nRemainder; + if (cb < 7) + { + SAL_WARN("sw.ww8", "WW8RStyle::ImportOldFormatStyles: expected byte count: " + << static_cast<int>(cb) << " to be >= 7"); + m_rStream.SeekRel(cb); + nByteCount += cb; + nRemainder = 0; + } + else + { + sal_uInt8 stc2(0); + m_rStream.ReadUChar(stc2); + m_rStream.SeekRel(6); + nByteCount += 7; + nRemainder = cb-7; + } aPAPXOffsets[stcp].mnOffset = m_rStream.Tell(); aPAPXOffsets[stcp].mnSize = nRemainder; |