Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f58f62eb authored by Colin Cross's avatar Colin Cross Committed by android code review
Browse files

Merge "libsparse: fix 32 bit overflow when calculating last chunk"

parents ec7d9dc7 f1ec8ac8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);