summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2014-08-15 23:31:52 +0200
committerDoug Zongker <dougz@google.com>2014-08-19 22:40:15 +0200
commit66f5ce387af87584b40eeec774429d7ead28b7cc (patch)
tree225eaa2234f683328b9055cd823017d8f748d9eb /applypatch/imgpatch.c
parentam 1a35a586: revert uncrypt back to dynamic linking, fix libs (diff)
downloadandroid_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar.gz
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar.bz2
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar.lz
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar.xz
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.tar.zst
android_bootable_recovery-66f5ce387af87584b40eeec774429d7ead28b7cc.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);