summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2014-08-20 00:53:10 +0200
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-19 04:43:23 +0200
commitc0fd40159cf329c54c96038d954c0b8c50a77970 (patch)
treea435cfd2bd1b457bb2e45304b8e75cd2e1305831 /applypatch/imgpatch.c
parentam 2efc9d99: clear BCB in misc partition before rebooting (diff)
parentinstaller for new block OTA system (diff)
downloadandroid_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar.gz
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar.bz2
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar.lz
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar.xz
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.tar.zst
android_bootable_recovery-c0fd40159cf329c54c96038d954c0b8c50a77970.zip
Diffstat (limited to 'applypatch/imgpatch.c')
-rw-r--r--applypatch/imgpatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/imgpatch.c b/applypatch/imgpatch.c
index af4d07281..33c448762 100644
--- a/applypatch/imgpatch.c
+++ b/applypatch/imgpatch.c
@@ -95,7 +95,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
printf("failed to read chunk %d raw data\n", i);
return -1;
}
- SHA_update(ctx, patch->data + pos, data_len);
+ if (ctx) SHA_update(ctx, patch->data + pos, data_len);
if (sink((unsigned char*)patch->data + pos,
data_len, token) != data_len) {
printf("failed to write chunk %d raw data\n", i);
@@ -217,7 +217,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
(long)have);
return -1;
}
- SHA_update(ctx, temp_data, have);
+ if (ctx) SHA_update(ctx, temp_data, have);
} while (ret != Z_STREAM_END);
deflateEnd(&strm);