Skip to content

Commit 397bada

Browse files
committed
Fix OverflowError in read_palette
CircuitPython now has overflow checks, so the old code crashes.
1 parent 733cdf5 commit 397bada

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def read_palette(self):
206206
for color in range(self.colors):
207207
buffer = f.read(4)
208208
c = color565(buffer[0], buffer[1], buffer[2])
209-
palette[color] = (c << 8) | (c >> 8)
209+
palette[color] = ((c << 8) | (c >> 8)) & 0xffff
210210
return palette
211211

212212
def read_data(self, offset=0, buffer=None):

0 commit comments

Comments
 (0)