Use bspatch from external/bsdiff.
Now ApplyBSDiffPatch() will stream the output to sink as we go instead of sinking everything at the end. Test: recovery_host_test Bug: 26982501 Change-Id: I05b6ed40d45e4b1b19ae72784cf705b731b976e3
This commit is contained in:
@@ -193,6 +193,9 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, const Value
|
||||
|
||||
// Next, apply the bsdiff patch (in memory) to the uncompressed data.
|
||||
std::vector<unsigned char> uncompressed_target_data;
|
||||
// TODO(senj): Remove the only usage of ApplyBSDiffPatchMem here,
|
||||
// replace it with ApplyBSDiffPatch with a custom sink function that
|
||||
// wraps the given sink function to stream output to save memory.
|
||||
if (ApplyBSDiffPatchMem(expanded_source.data(), expanded_len, patch, patch_offset,
|
||||
&uncompressed_target_data) != 0) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user