xdelta3-second.h (xdelta3-3.0.10) | : | xdelta3-second.h (xdelta3-3.0.11) | ||
---|---|---|---|---|
skipping to change at line 143 | skipping to change at line 143 | |||
/* Decode the size, allocate the buffer. */ | /* Decode the size, allocate the buffer. */ | |||
if ((ret = xd3_read_size (stream, & sect->buf, | if ((ret = xd3_read_size (stream, & sect->buf, | |||
sect->buf_max, & dec_size)) || | sect->buf_max, & dec_size)) || | |||
(ret = xd3_decode_allocate (stream, dec_size, | (ret = xd3_decode_allocate (stream, dec_size, | |||
& sect->copied2, & sect->alloc2))) | & sect->copied2, & sect->alloc2))) | |||
{ | { | |||
return ret; | return ret; | |||
} | } | |||
if (dec_size == 0) | ||||
{ | ||||
stream->msg = "secondary decoder invalid output size"; | ||||
return XD3_INVALID_INPUT; | ||||
} | ||||
out_used = sect->copied2; | out_used = sect->copied2; | |||
if ((ret = stream->sec_type->decode (stream, *sec_streamp, | if ((ret = stream->sec_type->decode (stream, *sec_streamp, | |||
& sect->buf, sect->buf_max, | & sect->buf, sect->buf_max, | |||
& out_used, out_used + dec_size))) | & out_used, out_used + dec_size))) | |||
{ | { | |||
return ret; | return ret; | |||
} | } | |||
if (sect->buf != sect->buf_max) | if (sect->buf != sect->buf_max) | |||
skipping to change at line 295 | skipping to change at line 301 | |||
{ | { | |||
tmp_tail = tmp_tail->next_page; | tmp_tail = tmp_tail->next_page; | |||
comp_size += tmp_tail->next; | comp_size += tmp_tail->next; | |||
} | } | |||
XD3_ASSERT (comp_size == xd3_sizeof_output (tmp_head)); | XD3_ASSERT (comp_size == xd3_sizeof_output (tmp_head)); | |||
XD3_ASSERT (tmp_tail != NULL); | XD3_ASSERT (tmp_tail != NULL); | |||
if (comp_size < (orig_size - SECONDARY_MIN_SAVINGS) || cfg->inefficient) | if (comp_size < (orig_size - SECONDARY_MIN_SAVINGS) || cfg->inefficient) | |||
{ | { | |||
IF_DEBUG1(DP(RINT "secondary saved %u bytes: %u -> %u (%0.2f%%)\n", | if (comp_size < orig_size) | |||
orig_size - comp_size, orig_size, comp_size, | { | |||
100.0 * (double) comp_size / (double) orig_size)); | IF_DEBUG1(DP(RINT "[encode_secondary] saved %u bytes: %u -> %u (%0.2f%% | |||
)\n", | ||||
orig_size - comp_size, orig_size, comp_size, | ||||
100.0 * (double) comp_size / (double) orig_size)); | ||||
} | ||||
xd3_free_output (stream, *head); | xd3_free_output (stream, *head); | |||
*head = tmp_head; | *head = tmp_head; | |||
*tail = tmp_tail; | *tail = tmp_tail; | |||
*did_it = 1; | *did_it = 1; | |||
} | } | |||
else | else | |||
{ | { | |||
getout: | getout: | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 13 lines changed or added |