liblp: Fix a crash when adding an image to a partition with no extents.
Bug: N/A Test: lpmake --partition=system:readonly:0 --image=system=system.img Change-Id: I4de616cc1b9ca2838d38518ec24a382f4bc1b1be
This commit is contained in:
parent
22387708fc
commit
8fc623eb63
1 changed files with 5 additions and 0 deletions
|
@ -312,6 +312,11 @@ static inline bool HasFillValue(uint32_t* buffer, size_t count) {
|
|||
|
||||
bool ImageBuilder::AddPartitionImage(const LpMetadataPartition& partition,
|
||||
const std::string& file) {
|
||||
if (partition.num_extents == 0) {
|
||||
LERROR << "Partition size is zero: " << GetPartitionName(partition);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Track which extent we're processing.
|
||||
uint32_t extent_index = partition.first_extent_index;
|
||||
|
||||
|
|
Loading…
Reference in a new issue