applypatch: Change the patch parameter to const Value& in Apply{BSDiff,Image}Patch.

It used to be "const Value*", but nullptr won't be a valid input.

Test: recovery_host_test; recovery_component_test
Change-Id: I904b5689ac3e64504088bf0544c9fb5d45a52243
This commit is contained in:
Tao Bao
2017-11-10 11:49:53 -08:00
parent 992bccfef4
commit 1e0941f4f6
5 changed files with 49 additions and 47 deletions

View File

@@ -651,11 +651,11 @@ static int GenerateTarget(const FileContents& source_file, const std::unique_ptr
int result;
if (use_bsdiff) {
result = ApplyBSDiffPatch(source_file.data.data(), source_file.data.size(), patch.get(), 0,
sink, &ctx);
result =
ApplyBSDiffPatch(source_file.data.data(), source_file.data.size(), *patch, 0, sink, &ctx);
} else {
result = ApplyImagePatch(source_file.data.data(), source_file.data.size(), patch.get(), sink,
&ctx, bonus_data);
result = ApplyImagePatch(source_file.data.data(), source_file.data.size(), *patch, sink, &ctx,
bonus_data);
}
if (result != 0) {