mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 04:56:57 +03:00
Check all reserved bytes in header
This commit is contained in:
parent
31eee6e5f7
commit
72c067af29
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -49,7 +49,12 @@ class FliImageFile(ImageFile.ImageFile):
|
|||
def _open(self) -> None:
|
||||
# HEAD
|
||||
s = self.fp.read(128)
|
||||
if not (_accept(s) and s[20:22] == b"\x00\x00"):
|
||||
if not (
|
||||
_accept(s)
|
||||
and s[20:22] == b"\x00" * 2
|
||||
and s[42:80] == b"\x00" * 38
|
||||
and s[88:] == b"\x00" * 40
|
||||
):
|
||||
msg = "not an FLI/FLC file"
|
||||
raise SyntaxError(msg)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user