[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Mon Sep 21 09:13:44 PDT 2015


 sw/qa/core/data/ww8/pass/hang-9.doc |binary
 sw/source/filter/ww8/ww8scan.cxx    |   12 ++++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 5a47be272727d3d300b4dcdc707375f24fb919eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 21 12:14:19 2015 +0100

    don't hang on busted subdocument offsets
    
    Change-Id: I5d1d18f864496ec98894703f0a22e211a9dd14a5
    (cherry picked from commit a2b90cd04733c2ec3b9cb3bb56d95f3298571ecc)
    Reviewed-on: https://gerrit.libreoffice.org/18747
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/core/data/ww8/pass/hang-9.doc b/sw/qa/core/data/ww8/pass/hang-9.doc
new file mode 100644
index 0000000..4e9e412
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-9.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 867a0e7..109a3c2 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4450,11 +4450,15 @@ void WW8PLCFxDesc::ReduceByOffset()
         else
             nStartPos -= nCpOfs;
     }
-    if( nEndPos != WW8_CP_MAX )
+    if (nEndPos != WW8_CP_MAX)
     {
-        OSL_ENSURE(nCpOfs <= nEndPos,
-            "oh oh, so much for the subdocument piece theory");
-        nEndPos   -= nCpOfs;
+        if (nCpOfs > nEndPos)
+        {
+            SAL_WARN("sw.ww8", "broken subdocument piece entry");
+            nEndPos = WW8_CP_MAX;
+        }
+        else
+            nEndPos -= nCpOfs;
     }
 }
 


More information about the Libreoffice-commits mailing list