From 319d725c73b8bf60158961aa0b014258708effab Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 21 Aug 2015 13:26:44 +0100 Subject: don't crash due to earlier short reads Change-Id: I682a9bf72cbe18999c0c5acc495e813727e0e372 (cherry picked from commit 0030efe09ad9447933ac3b1875c270ed1649aee7) Reviewed-on: https://gerrit.libreoffice.org/17903 Reviewed-by: David Tardon Tested-by: David Tardon --- sw/qa/core/data/ww6/pass/crash-4.doc | Bin 0 -> 6611 bytes sw/source/filter/ww8/ww8par2.cxx | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 sw/qa/core/data/ww6/pass/crash-4.doc diff --git a/sw/qa/core/data/ww6/pass/crash-4.doc b/sw/qa/core/data/ww6/pass/crash-4.doc new file mode 100644 index 000000000000..5abaecc2b3c0 Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-4.doc differ diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 16273ed56f49..f214746c1bde 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4380,6 +4380,9 @@ void WW8RStyle::ImportOldFormatStyles() if (eSti == ww::stiNil) continue; + if (stcp >= aPAPXOffsets.size()) + continue; + rSI.bValid = true; if (ww::StandardStiIsCharStyle(eSti) && !aPAPXOffsets[stcp].mnSize) -- cgit v1.2.3