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

Caolán McNamara caolanm at redhat.com
Wed Aug 12 03:52:59 PDT 2015


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

New commits:
commit df28da238abec9af5e41539a876dd1856c7e4523
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 11 20:58:22 2015 +0100

    avoid another hang with certain .docs
    
    (cherry picked from commit 0592da19b625975886d3442477f4399660736a69)
    
    Change-Id: If16e90c5ba1a43ceb9702e752835928da7b3ef32
    Reviewed-on: https://gerrit.libreoffice.org/17666
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/qa/core/data/ww8/pass/hang-3.doc b/sw/qa/core/data/ww8/pass/hang-3.doc
new file mode 100644
index 0000000..4188b80
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-3.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0215253..1c42ce0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2288,7 +2288,7 @@ void SwWW8ImplReader::Read_HdFtText(WW8_CP nStart, WW8_CP nLen, SwFrmFmt* pHdFtF
 bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const
 {
     // Each CP of Plcfhdd MUST be less than FibRgLw97.ccpHdd
-    return (nHeaderCP < pWwFib->ccpHdr);
+    return (nHeaderCP < pWwFib->ccpHdr && nHeaderCP >= 0);
 }
 
 bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIhdt,
@@ -2306,7 +2306,7 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIh
             {
                 bool bOk = true;
                 if( bVer67 )
-                    bOk = ( pHdFt->GetTextPos(grpfIhdt, nI, start, nLen ) && nLen >= 2 );
+                    bOk = ( pHdFt->GetTextPos(grpfIhdt, nI, start, nLen ) && start >= 0 && nLen >= 2 );
                 else
                 {
                     pHdFt->GetTextPosExact( static_cast< short >(nNumber + (nSect+1)*6), start, nLen);


More information about the Libreoffice-commits mailing list