Skip to content

Commit ef3b78b

Browse files
authored
Merge pull request #117 from SReich-EMI/patch-1
check for number of color changes overflow
2 parents 61122b9 + 94771e3 commit ef3b78b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pyembroidery/PecWriter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def write_pec_header(pattern, f, threadlist):
6060
f.write(b"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20")
6161
add_value = current_thread_count - 1
6262
color_index_list.insert(0, add_value)
63+
assert color_index_list[0]<255, 'to many color changes, ({0}) out of bounds (0, 255)'.format(len(color_index_list))
6364
f.write(bytes(bytearray(color_index_list)))
6465
else:
6566
f.write(b"\x20\x20\x20\x20\x64\x20\x00\x20\x00\x20\x20\x20\xFF")

0 commit comments

Comments
 (0)