sw/qa/core/data/ww6/pass/crash-1.doc |binary sw/qa/core/filters-test.cxx | 4 ++++ sw/source/filter/ww8/ww8par2.cxx | 29 ++++++++++++++++------------- 3 files changed, 20 insertions(+), 13 deletions(-)
New commits: commit 266b2e777de0a5d82a7bd493d486f208710e7f4f Author: Caolán McNamara <caol...@redhat.com> Date: Fri Aug 21 09:52:29 2015 +0100 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 <dtar...@redhat.com> Tested-by: David Tardon <dtar...@redhat.com> diff --git a/sw/qa/core/data/ww6/fail/.gitignore b/sw/qa/core/data/ww6/fail/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/sw/qa/core/data/ww6/indeterminate/.gitignore b/sw/qa/core/data/ww6/indeterminate/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/sw/qa/core/data/ww6/pass/.gitignore b/sw/qa/core/data/ww6/pass/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/sw/qa/core/data/ww6/pass/crash-1.doc b/sw/qa/core/data/ww6/pass/crash-1.doc new file mode 100644 index 0000000..3c6f684 Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-1.doc differ diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 527f3ae..852bced 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -151,6 +151,10 @@ void SwFiltersTest::testCVEs() getURLFromSrc("/sw/qa/core/data/ww8/"), OUString(FILTER_WW8)); + testDir(OUString("MS WinWord 6.0"), + getURLFromSrc("/sw/qa/core/data/ww6/"), + OUString(sWW6)); + testDir(OUString("MS WinWord 5"), getURLFromSrc("/sw/qa/core/data/ww5/"), OUString(sWW5)); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index b81f630..25d7839 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);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits