am 34fd8596: am f58f62eb: Merge "libsparse: fix 32 bit overflow when calculating last chunk"

* commit '34fd8596463832c1ce670f436b31ed851552c8f4':
  libsparse: fix 32 bit overflow when calculating last chunk
This commit is contained in:
Colin Cross 2012-07-23 19:53:20 -07:00 committed by Android Git Automerger
commit 8edbbde249
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ static int write_all_blocks(struct sparse_file *s, struct output_file *out)
DIV_ROUND_UP(backed_block_len(bb), s->block_size);
}
pad = s->len - last_block * s->block_size;
pad = s->len - (int64_t)last_block * s->block_size;
assert(pad >= 0);
if (pad > 0) {
write_skip_chunk(out, pad);