mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-12-02 00:51:41 +00:00
Added check for incomplete file in container unpacking
This commit is contained in:
parent
cdac32238e
commit
5f5e911d10
@ -23,7 +23,10 @@ class DiskImageContainer:
|
|||||||
|
|
||||||
def __unpack_raw_data(self, data):
|
def __unpack_raw_data(self, data):
|
||||||
raw = data.tobytes()
|
raw = data.tobytes()
|
||||||
|
try:
|
||||||
unpacked = self.unpack_bytes(raw)
|
unpacked = self.unpack_bytes(raw)
|
||||||
|
except EOFError as e:
|
||||||
|
raise errors.InvalidContainer(e)
|
||||||
return to_numpy(unpacked)
|
return to_numpy(unpacked)
|
||||||
|
|
||||||
def unpack_bytes(self, byte_data):
|
def unpack_bytes(self, byte_data):
|
||||||
|
Loading…
Reference in New Issue
Block a user