diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-27 23:52:15 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-05-27 23:52:15 +0200 |
commit | a2164fc2eb4f67b5ed62a593706ee68adabc07f1 (patch) | |
tree | 4de471420cdcb9269cb1864b75f9b3f2554bd29f | |
parent | 1697c7ab95581c67435a11798451fa63d6002938 (diff) |
add ww6 test dir and fix a crash
Change-Id: Id08176640672095c03e0b124cd65a9dce26ac2db
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index fcb5b504e459..1871ecd0cfdf 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4272,6 +4272,14 @@ void WW8RStyle::ImportOldFormatStyles() std::vector< std::vector<sal_uInt8> > aConvertedChpx; while (nByteCount < cbChpx) { + if (stcp == aCHPXOffsets.size()) + { + //more data than style slots, skip remainder + rSt.SeekRel(cbChpx-nByteCount); + nByteCount += cbChpx-nByteCount; + break; + } + sal_uInt8 cb; rSt >> cb; nByteCount++; @@ -4294,12 +4302,7 @@ void WW8RStyle::ImportOldFormatStyles() else aConvertedChpx.push_back( std::vector<sal_uInt8>() ); - stcp++; - if (stcp == nStyles) - { - rSt.SeekRel(cbChpx-nByteCount); - nByteCount += cbChpx-nByteCount; - } + ++stcp; } std::vector<pxoffset> aPAPXOffsets(stcp); @@ -4309,6 +4312,12 @@ void WW8RStyle::ImportOldFormatStyles() stcp=0; while (nByteCount < cbPapx) { + if (stcp == aPAPXOffsets.size()) + { + rSt.SeekRel(cbPapx-nByteCount); + nByteCount += cbPapx-nByteCount; + } + sal_uInt8 cb; rSt >> cb; nByteCount++; @@ -4330,13 +4339,7 @@ void WW8RStyle::ImportOldFormatStyles() nByteCount += nRemainder; } - stcp++; - - if (stcp == nStyles) - { - rSt.SeekRel(cbPapx-nByteCount); - nByteCount += cbPapx-nByteCount; - } + ++stcp; } sal_uInt16 iMac; |