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

Caolán McNamara caolanm at redhat.com
Mon Aug 24 03:17:23 PDT 2015


 sw/source/filter/ww8/ww8scan.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit bb42fca87937c0fdcbb3338d5eefbc3a3d6311ad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 24 09:37:11 2015 +0100

    dismiss bad seek offsets early
    
    Change-Id: Ia88bc1833d362547f45e073028203a4de581f3e2
    (cherry picked from commit 8657e3795d2e0ef0653835e2d56c53512dd43aea)
    Reviewed-on: https://gerrit.libreoffice.org/17947
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index f66b7fc..7b65eb6 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -7530,7 +7530,8 @@ SEPr::SEPr() :
 
 bool checkSeek(SvStream &rSt, sal_uInt32 nOffset)
 {
-    return (rSt.Seek(nOffset) == static_cast<sal_Size>(nOffset));
+    return (nOffset != SAL_MAX_UINT32 &&
+            rSt.Seek(nOffset) == static_cast<sal_Size>(nOffset));
 }
 
 bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
commit ed2824ca101b7ea5e898ed4c7a205359e37b3eed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 24 09:36:42 2015 +0100

    fix crash with empty booknames
    
    Change-Id: Ifadb2129be53530720cb2023cdc0782b6e737f18
    (cherry picked from commit 11e73a0880f64c99aec5059ff6122b831bc1de74)
    Reviewed-on: https://gerrit.libreoffice.org/17946
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index b3a9b1d..f66b7fc 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4183,17 +4183,18 @@ bool WW8PLCFx_Book::MapName(OUString& rName)
         return false;
 
     bool bFound = false;
-    sal_uInt16 i = 0;
-    do
+
+    size_t i = 0;
+    while (i < aBookNames.size())
     {
         if (rName.equalsIgnoreAsciiCase(aBookNames[i]))
         {
             rName = aBookNames[i];
             bFound = true;
+            break;
         }
         ++i;
     }
-    while (!bFound && i < pBook[0]->GetIMax());
     return bFound;
 }
 


More information about the Libreoffice-commits mailing list