Commit c8eb4aa
committed
fix: Block checksum 32-bit overflow in _calc_chksum
The checksum accumulator was not masked to 32 bits during addition,
only at the end. With Python's arbitrary-precision integers, this
caused the sum to exceed 32 bits, producing wrong checksums for
blocks with large unsigned values (common in RDB headers).
Fix: mask with & 0xFFFFFFFF on each addition step.
This fixes RDB validation failing on valid Amiga disk images.1 parent 3b57f20 commit c8eb4aa
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
0 commit comments