mirror of
https://github.com/derrod/legendary.git
synced 2026-04-16 09:09:05 +00:00
fix: save-sync chunk read crash (#747)
This commit is contained in:
parent
41e3cfab82
commit
aeb61d4eea
|
|
@ -92,12 +92,14 @@ class Chunk:
|
|||
return self.stored_as & 0x2
|
||||
|
||||
@classmethod
|
||||
def read_buffer(cls, data, secrets):
|
||||
def read_buffer(cls, data, secrets=None):
|
||||
_sio = BytesIO(data)
|
||||
return cls.read(_sio, secrets)
|
||||
|
||||
@classmethod
|
||||
def read(cls, bio, secrets=dict()):
|
||||
def read(cls, bio, secrets=None):
|
||||
if secrets is None:
|
||||
secrets = dict()
|
||||
head_start = bio.tell()
|
||||
|
||||
if struct.unpack('<I', bio.read(4))[0] != cls.header_magic:
|
||||
|
|
|
|||
Loading…
Reference in a new issue