aboutsummaryrefslogtreecommitdiff
path: root/applypatch/imgpatch.cpp
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2016-05-10 15:23:25 -0700
committerSen Jiang <senj@google.com>2017-02-02 14:41:05 -0800
commit25c56979dd85a33a6467949ab76f99a987a0a006 (patch)
treed2a3fb6629462d5a2c672254ef45762b06a4e8ef /applypatch/imgpatch.cpp
parent7f38fbf976bd9fb145925a803af49410fa43a8a6 (diff)
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
Diffstat (limited to 'applypatch/imgpatch.cpp')
-rw-r--r--applypatch/imgpatch.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/applypatch/imgpatch.cpp b/applypatch/imgpatch.cpp
index 00ea90ef..8f4a2a42 100644
--- a/applypatch/imgpatch.cpp
+++ b/applypatch/imgpatch.cpp
@@ -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;