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

Commit 8ef44309 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix GetCareMap for small images"

parents d541c6c8 98ef7bb1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3892,7 +3892,10 @@ def GetCareMap(which, imgname):
  disable_sparse = OPTIONS.info_dict.get(which + "_disable_sparse")

  image_blocks = int(image_size) // 4096 - 1
  assert image_blocks > 0, "blocks for {} must be positive".format(which)
  # It's OK for image_blocks to be 0, because care map ranges are inclusive.
  # So 0-0 means "just block 0", which is valid.
  assert image_blocks >= 0, "blocks for {} must be non-negative, image size: {}".format(
      which, image_size)

  # For sparse images, we will only check the blocks that are listed in the care
  # map, i.e. the ones with meaningful data.