Skip to content

Commit a6dfe11

Browse files
Further fix for block reading
1 parent 1b1ca94 commit a6dfe11

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

music/tracked/it/it.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,17 @@ blockReadLoop:
9898
break blockReadLoop
9999
}
100100

101+
blen := block.Length()
102+
if blen < 8 {
103+
break blockReadLoop
104+
}
105+
106+
if block.FourCC() == 0x494d5049 { // IMPI
107+
break blockReadLoop
108+
}
109+
101110
f.Blocks = append(f.Blocks, block)
102-
nextValPos += ParaPointer32(block.Length())
111+
nextValPos += ParaPointer32(blen)
103112

104113
if nextValPos.Offset() < len(data) {
105114
valPos = nextValPos

0 commit comments

Comments
 (0)