Skip to content

Commit 8d68c7f

Browse files
authored
Merge pull request #800 from effigies/backport-798
BF: Fix hardcoded maximum number of CSA tags
2 parents 08b430f + 08f6dd3 commit 8d68c7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/nicom/csareader.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def read(csa_str):
9898
hdr_type = 1
9999
csa_dict['type'] = hdr_type
100100
csa_dict['n_tags'], csa_dict['check'] = up_str.unpack('2I')
101-
if not 0 < csa_dict['n_tags'] <= 128:
101+
if not 0 < csa_dict['n_tags'] <= MAX_CSA_ITEMS:
102102
raise CSAReadError('Number of tags `t` should be '
103-
'0 < t <= 128')
103+
'0 < t <= %d' % MAX_CSA_ITEMS)
104104
for tag_no in range(csa_dict['n_tags']):
105105
name, vm, vr, syngodt, n_items, last3 = \
106106
up_str.unpack('64si4s3i')

0 commit comments

Comments
 (0)