Check the results from applypatch
am: 31f8cc84cf

Change-Id: I2ea241fb3e688f5f8b0558d638dd3ed502223f97
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 7aff7ff..f00bc4b 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1264,11 +1264,17 @@
             }
 
             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.