Merge "liblp: SparseBuilder: num_blocks aren't check correctly" am: af4a0e846e am: a6f70fb0e4
am: 7b8d3e8d18
Change-Id: I60040137fb49c16bd9c9b66b30c7264e139e4ddc
diff --git a/fs_mgr/liblp/images.cpp b/fs_mgr/liblp/images.cpp
index a976643..a46836e 100644
--- a/fs_mgr/liblp/images.cpp
+++ b/fs_mgr/liblp/images.cpp
@@ -120,7 +120,7 @@
return;
}
- uint64_t num_blocks = total_size % block_size;
+ uint64_t num_blocks = total_size / block_size;
if (num_blocks >= UINT_MAX) {
// libsparse counts blocks in unsigned 32-bit integers, so we check to
// make sure we're not going to overflow.