summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-04-26 19:07:33 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-04-26 19:07:33 +0200
commitce5e980835aefc5d00bd22b07d786b43aedb4211 (patch)
treead04f84cdc1c0e6c1a69fdc6f720733a3f1501d8
parentMerge "minadbd: Fix a failing test due to SIGPIPE." am: 7b1fffe095 am: f849ff34d4 (diff)
parentMerge "applypatch: Add determine the return value of ApplyDiffPatch and capture the error flow." am: ac78ed8915 (diff)
downloadandroid_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar.gz
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar.bz2
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar.lz
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar.xz
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.tar.zst
android_bootable_recovery-ce5e980835aefc5d00bd22b07d786b43aedb4211.zip
-rw-r--r--applypatch/imgpatch.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/applypatch/imgpatch.cpp b/applypatch/imgpatch.cpp
index 7d8b7361c..3d905f7b4 100644
--- a/applypatch/imgpatch.cpp
+++ b/applypatch/imgpatch.cpp
@@ -100,7 +100,10 @@ int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value*
printf("source data too short\n");
return -1;
}
- ApplyBSDiffPatch(old_data + src_start, src_len, patch, patch_offset, sink, ctx);
+ if (ApplyBSDiffPatch(old_data + src_start, src_len, patch, patch_offset, sink, ctx) != 0) {
+ printf("Failed to apply bsdiff patch.\n");
+ return -1;
+ }
} else if (type == CHUNK_RAW) {
const char* raw_header = &patch->data[pos];
pos += 4;