summaryrefslogtreecommitdiffstats
path: root/applypatch/imgdiff.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-05-24 07:23:31 +0200
committerTianjie Xu <xunchang@google.com>2018-05-24 19:49:54 +0200
commitcc61cf6a9f74400956886c7f91efef581f4184e2 (patch)
tree3647f091fdaf8f61f3b97de44fdecee6aff1f782 /applypatch/imgdiff.cpp
parentMerge "recovery: Refactor common setup into main()" (diff)
downloadandroid_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.gz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.bz2
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.lz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.xz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.zst
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.zip
Diffstat (limited to 'applypatch/imgdiff.cpp')
-rw-r--r--applypatch/imgdiff.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/imgdiff.cpp b/applypatch/imgdiff.cpp
index 674cc2b16..415d95f14 100644
--- a/applypatch/imgdiff.cpp
+++ b/applypatch/imgdiff.cpp
@@ -462,12 +462,12 @@ PatchChunk::PatchChunk(const ImageChunk& tgt)
target_len_(tgt.GetRawDataLength()),
target_uncompressed_len_(tgt.DataLengthForPatch()),
target_compress_level_(tgt.GetCompressLevel()),
- data_(tgt.DataForPatch(), tgt.DataForPatch() + tgt.DataLengthForPatch()) {}
+ data_(tgt.GetRawData(), tgt.GetRawData() + tgt.GetRawDataLength()) {}
// Return true if raw data is smaller than the patch size.
bool PatchChunk::RawDataIsSmaller(const ImageChunk& tgt, size_t patch_size) {
size_t target_len = tgt.GetRawDataLength();
- return (tgt.GetType() == CHUNK_NORMAL && (target_len <= 160 || target_len < patch_size));
+ return target_len < patch_size || (tgt.GetType() == CHUNK_NORMAL && target_len <= 160);
}
void PatchChunk::UpdateSourceOffset(const SortedRangeSet& src_range) {