compressWithFilters(..., inhibit_compression_check=0) // SourceForge bug 3541020

Not good to check compression ratio on every block when blocksize < file_size,
as when --force_execve of Elf > 0x80000 bytes.
This commit is contained in:
John Reiser
2012-07-12 07:04:56 -07:00
parent a6d717cb04
commit f383629282
3 changed files with 28 additions and 16 deletions
+3 -1
View File
@@ -142,6 +142,7 @@ void PackUnix::pack2(OutputFile *fo, Filter &ft)
// ui_total_passes = 0;
unsigned remaining = file_size;
unsigned n_block = 0;
while (remaining > 0)
{
// FIXME: disable filters if we have more than one block.
@@ -170,7 +171,8 @@ void PackUnix::pack2(OutputFile *fo, Filter &ft)
// that is, AFTER filtering. We want BEFORE filtering,
// so that decompression checks the end-to-end checksum.
unsigned const end_u_adler = upx_adler32(ibuf, ph.u_len, ph.u_adler);
compressWithFilters(&ft, OVERHEAD, NULL_cconf, filter_strategy);
compressWithFilters(&ft, OVERHEAD, NULL_cconf, filter_strategy,
!!n_block++); // check compression ratio only on first block
if (ph.c_len < ph.u_len) {
const upx_bytep tbuf = NULL;