Skip to content

Commit d1c3ec8

Browse files
committed
fix another overflow
1 parent b2a358a commit d1c3ec8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ def _parse_header(self):
276276
self.internal_unit_ids = [] # pair of chan['packet_id'], spikes['unit_class_nb']
277277
for i in range(len(self.__nev_ext_header[b"NEUEVWAV"])):
278278

279-
channel_id = self.__nev_ext_header[b"NEUEVWAV"]["electrode_id"][i]
279+
# electrode_id values are stored at uint16 which can be overflowed when
280+
# multiplying by 1000 below. We convert to a regular pyton into which
281+
# won't overflow
282+
channel_id = int(self.__nev_ext_header[b"NEUEVWAV"]["electrode_id"][i])
280283

281284
chan_mask = spikes["packet_id"] == channel_id
282285
chan_spikes = spikes[chan_mask]

0 commit comments

Comments
 (0)