From: <lab...@us...> - 2011-04-11 17:42:44
|
Revision: 1352 http://opengtoolkit.svn.sourceforge.net/opengtoolkit/?rev=1352&view=rev Author: labviewer Date: 2011-04-11 17:42:38 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Minor bug fixes to the zlip/minizip C sources Modified Paths: -------------- trunk/lvzip/c_source/unzip.c trunk/lvzip/c_source/zip.c trunk/lvzip/source/lvzlib.dll Modified: trunk/lvzip/c_source/unzip.c =================================================================== --- trunk/lvzip/c_source/unzip.c 2011-04-11 00:34:37 UTC (rev 1351) +++ trunk/lvzip/c_source/unzip.c 2011-04-11 17:42:38 UTC (rev 1352) @@ -1142,7 +1142,7 @@ szFileName,fileNameBufferSize, extraField,extraFieldBufferSize, szComment,commentBufferSize); - if (err==UNZ_OK) + if ((err==UNZ_OK) && (pfile_info!=NULL)) { pfile_info->version = file_info64.version; pfile_info->version_needed = file_info64.version_needed; Modified: trunk/lvzip/c_source/zip.c =================================================================== --- trunk/lvzip/c_source/zip.c 2011-04-11 00:34:37 UTC (rev 1351) +++ trunk/lvzip/c_source/zip.c 2011-04-11 17:42:38 UTC (rev 1352) @@ -1710,7 +1710,7 @@ if (err==ZIP_OK) err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ - if(uncompressed_size >= 0xffffffff) + if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff) { if(zi->ci.pos_zip64extrainfo > 0) { @@ -1724,7 +1724,9 @@ if (err==ZIP_OK) /* uncompressed size, unknown */ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8); } - } + else + err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal + } else { if (err==ZIP_OK) /* compressed size, unknown */ @@ -1852,7 +1854,7 @@ err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4); } else - err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); } return err; @@ -1919,7 +1921,7 @@ free_linkedlist(&(zi->central_dir)); pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; - if(pos >= 0xffffffff) + if (pos >= 0xffffffff || zi->number_entry > 0xFFFF) { ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); Modified: trunk/lvzip/source/lvzlib.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |