summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMikhail Voitenko <mav@openoffice.org>2009-12-16 14:02:04 +0000
committerMikhail Voitenko <mav@openoffice.org>2009-12-16 14:02:04 +0000
commit540e80d2fcbffc1eb6ee15f475c079d85f4baff9 (patch)
treea81eea43866e6be158f0a1d8cb5a5772d93ee347 /package
parentb87a09786de6f985602ef29f275f44a9944992ce (diff)
#i107688# handle the broken documents correctly
Diffstat (limited to 'package')
-rw-r--r--package/source/zipapi/ZipFile.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index f6dafac4cb6a..9934caa0c066 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -880,8 +880,8 @@ sal_Int32 ZipFile::recover()
if ( aEntry.nExtraLen < 0 ) aEntry.nExtraLen = 0x7FFF;
// End of quick fix
-
- sal_Int32 nBlockLength = aEntry.nSize + aEntry.nPathLen + aEntry.nExtraLen + 30 + nDescrLength;
+ sal_Int32 nDataSize = ( aEntry.nMethod == DEFLATED ) ? aEntry.nCompressedSize : aEntry.nSize;
+ sal_Int32 nBlockLength = nDataSize + aEntry.nPathLen + aEntry.nExtraLen + 30 + nDescrLength;
if ( aEntry.nPathLen <= ZIP_MAXNAMELEN && aEntry.nExtraLen < ZIP_MAXEXTRA
&& ( nGenPos + nPos + nBlockLength ) <= nLength )
{