[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 5 commits - package/source

Petr Mladek pmladek at kemper.freedesktop.org
Fri Jan 7 11:16:30 PST 2011


 package/source/zipapi/ZipFile.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 46bf8d4d5e0e45ce632330289516db4af4729d33
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Jan 7 20:12:40 2011 +0100

    Micro optimization of the last commit
    
    nBufSize was set by aBuffer.getLength() and had not been used in the end

diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index c99c965..7a1b5d9 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -853,7 +853,7 @@ sal_Int32 ZipFile::recover()
             // the buffer should contain at least one header,
             // or if it is end of the file, at least the postheader with sizes and hash
             while( nPos < nBufSize - 30
-                || ( aBuffer.getLength() < nToRead && nPos < nBufSize - 16 ) )
+                || ( nBufSize < nToRead && nPos < nBufSize - 16 ) )
 
             {
                 if ( nPos < nBufSize - 30 && pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 3 && pBuffer[nPos+3] == 4 )
commit f2d22b6bb9c7cbd7573f23b116c2082224b4f0fd
Merge: 3032196... 2aa1dc9...
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Jan 7 20:06:19 2011 +0100

    Merge commit 'ooo/OOO330_m19' into libreoffice-3-3

commit 2aa1dc9a47787f2e499a22c901a52939e77a27bc
Merge: 03cfe2c... 2c23085...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Thu Jan 6 14:58:44 2011 +0100

    CWS-TOOLING: integrate CWS impress208

commit 2c230853f4941b87edc438a6ac0021d1f16730b0
Author: Christian Lippka ORACLE <christian.lippka at oracle.com>
Date:   Wed Jan 5 12:10:11 2011 +0100

    impress208: #i115944# fixing large ooxml files

diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index e95ba97..3f98ede 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -836,14 +836,18 @@ sal_Int32 ZipFile::recover()
 
         aGrabber.seek( 0 );
 
-        // TODO/LATER: let the files > 2Gb handle the 2Gb border correctly ( if header is splitted )
-        for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, SAL_MAX_INT32 ) && aBuffer.getLength() > 30; )
+        const sal_Int32 nToRead = 32000;
+        for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, nToRead ) && aBuffer.getLength() > 16; )
         {
             const sal_Int8 *pBuffer = aBuffer.getConstArray();
             sal_Int32 nBufSize = aBuffer.getLength();
 
             sal_Int32 nPos = 0;
-            while( nPos < nBufSize - 16 )
+            // the buffer should contain at least one header,
+            // or if it is end of the file, at least the postheader with sizes and hash
+            while( nPos < nBufSize - 30
+                || ( aBuffer.getLength() < nToRead && nPos < nBufSize - 16 ) )
+
             {
                 if ( nPos < nBufSize - 30 && pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 3 && pBuffer[nPos+3] == 4 )
                 {
commit 3e36a47e3877299b34e7e7677f9ca2c4510f1e0a
Author: Christian Lippka ORACLE <christian.lippka at oracle.com>
Date:   Mon Jan 3 18:09:17 2011 +0100

    impress208: #i115944# fixing large ooxml files

diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index ce43786..e95ba97 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -836,7 +836,8 @@ sal_Int32 ZipFile::recover()
 
         aGrabber.seek( 0 );
 
-        for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, 32000 ) && aBuffer.getLength() > 30; )
+        // TODO/LATER: let the files > 2Gb handle the 2Gb border correctly ( if header is splitted )
+        for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, SAL_MAX_INT32 ) && aBuffer.getLength() > 30; )
         {
             const sal_Int8 *pBuffer = aBuffer.getConstArray();
             sal_Int32 nBufSize = aBuffer.getLength();


More information about the Libreoffice-commits mailing list