mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-01-01 17:30:41 +00:00
Fixed an infinite loop
Parsing this new file from soundgrinder seems to be error-prone, for now this fixes it.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
import struct
|
||||
|
||||
import pdb
|
||||
from collections import namedtuple
|
||||
|
||||
class ListChunkDescriptor(namedtuple('ListChunkDescriptor' , 'signature children')):
|
||||
@@ -30,11 +30,16 @@ def parse_list_chunk(stream, length):
|
||||
|
||||
children = []
|
||||
while (stream.tell() - start) < length:
|
||||
children.append(parse_chunk(stream))
|
||||
child_chunk = parse_chunk(stream)
|
||||
if child_chunk:
|
||||
children.append(child_chunk)
|
||||
else:
|
||||
break
|
||||
|
||||
return ListChunkDescriptor(signature=signature, children=children)
|
||||
|
||||
def parse_chunk(stream):
|
||||
#breakpoint()
|
||||
ident = stream.read(4)
|
||||
if len(ident) != 4:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user