diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-21 09:52:29 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-08-21 14:49:31 +0000 |
commit | 266b2e777de0a5d82a7bd493d486f208710e7f4f (patch) | |
tree | 71bc19f0a5a319442be80488d60ffa8015fbf55a /sw/source/filter | |
parent | 3c393ce71d18c24d5e2a63b1661b05b4e80f8510 (diff) |
add ww6 test dir and fix a crash
Change-Id: Id08176640672095c03e0b124cd65a9dce26ac2db
(cherry picked from commit 42a709d1ef647aab9a1c9422b4e25ecaee857aba)
Reviewed-on: https://gerrit.libreoffice.org/17890
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sw/source/filter')
-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 b81f630c3f12..25d78393dc42 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4274,6 +4274,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(0); rSt.ReadUChar( cb ); nByteCount++; @@ -4296,12 +4304,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); @@ -4318,6 +4321,12 @@ void WW8RStyle::ImportOldFormatStyles() stcp=0; while (nByteCount < cbPapx) { + if (stcp == aPAPXOffsets.size()) + { + rSt.SeekRel(cbPapx-nByteCount); + nByteCount += cbPapx-nByteCount; + } + sal_uInt8 cb(0); rSt.ReadUChar( cb ); nByteCount++; @@ -4339,13 +4348,7 @@ void WW8RStyle::ImportOldFormatStyles() nByteCount += nRemainder; } - stcp++; - - if (stcp == nStyles) - { - rSt.SeekRel(cbPapx-nByteCount); - nByteCount += cbPapx-nByteCount; - } + ++stcp; } sal_uInt16 iMac(0); |