summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-06-15 20:56:42 +0200
committerTianjie Xu <xunchang@google.com>2016-06-16 01:26:59 +0200
commit31f8cc84cfc14eecdd96c6ca8eb411aa8610db22 (patch)
tree5358e7b58485548550f180935158644f9c716e84
parentapplypatch: Don't call inflate() when it expects zero-length output. (diff)
downloadandroid_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar.gz
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar.bz2
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar.lz
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar.xz
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.tar.zst
android_bootable_recovery-31f8cc84cfc14eecdd96c6ca8eb411aa8610db22.zip
-rw-r--r--updater/blockimg.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index f7955566d..a80180a9a 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1267,11 +1267,17 @@ static int PerformCommandDiff(CommandParameters& params) {
}
if (params.cmdname[0] == 'i') { // imgdiff
- ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value,
- &RangeSinkWrite, &rss, nullptr, nullptr);
+ if (ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value,
+ &RangeSinkWrite, &rss, nullptr, nullptr) != 0) {
+ fprintf(stderr, "Failed to apply image patch.\n");
+ return -1;
+ }
} else {
- ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value, 0,
- &RangeSinkWrite, &rss, nullptr);
+ if (ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value,
+ 0, &RangeSinkWrite, &rss, nullptr) != 0) {
+ fprintf(stderr, "Failed to apply bsdiff patch.\n");
+ return -1;
+ }
}
// We expect the output of the patcher to fill the tgt ranges exactly.