Remove the assumption of target chunk size in imgdiff
In the split mode of imgdiff, we used to assume that the size of a split target chunk is always greater than the blocksize i.e. 4096. This may lead to the following assertion failure: I0221 04:57:33.451323 818464 common.py:205 imgdiff F 02-21 04:57:33 821203 821203 imgdiff.cpp:999] Check failed: tgt_size >= BLOCK_SIZE (tgt_size=476, BLOCK_SIZE=4096) This CL removes the assumption and handles the edge cases. Test: generate and verify the incremental update for TFs in the bug; unit test passes Bug: 73757557 Bug: 73711365 Change-Id: Iadbb4ee658995f5856cd488f3793980881a59620
This commit is contained in:
@@ -265,8 +265,9 @@ class ZipModeImage : public Image {
|
||||
std::vector<SortedRangeSet>& split_src_ranges,
|
||||
size_t total_tgt_size);
|
||||
// Construct the dummy split images based on the chunks info and source ranges; and move them into
|
||||
// the given vectors.
|
||||
static void AddSplitImageFromChunkList(const ZipModeImage& tgt_image,
|
||||
// the given vectors. Return true if we add a new split image into |split_tgt_images|, and
|
||||
// false otherwise.
|
||||
static bool AddSplitImageFromChunkList(const ZipModeImage& tgt_image,
|
||||
const ZipModeImage& src_image,
|
||||
const SortedRangeSet& split_src_ranges,
|
||||
const std::vector<ImageChunk>& split_tgt_chunks,
|
||||
|
||||
Reference in New Issue
Block a user