Skip to content

Commit

Permalink
Error on zero-sized bins
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Nov 17, 2024
1 parent bdc8ce7 commit 05f60ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/splat/segtypes/common/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def split(self, rom_bytes):
f"segment {self.name} needs to know where it ends; add a position marker [0xDEADBEEF] after it"
)

if self.size is None or self.size <= 0:
log.error(f"Segment {self.name} has zero size.")

with open(path, "wb") as f:
assert isinstance(self.rom_start, int)
assert isinstance(self.rom_end, int)
Expand Down

0 comments on commit 05f60ae

Please sign in to comment.