Skip to content

Commit 72c067a

Browse files
committed
Check all reserved bytes in header
1 parent 31eee6e commit 72c067a

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/PIL/FliImagePlugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ class FliImageFile(ImageFile.ImageFile):
4949
def _open(self) -> None:
5050
# HEAD
5151
s = self.fp.read(128)
52-
if not (_accept(s) and s[20:22] == b"\x00\x00"):
52+
if not (
53+
_accept(s)
54+
and s[20:22] == b"\x00" * 2
55+
and s[42:80] == b"\x00" * 38
56+
and s[88:] == b"\x00" * 40
57+
):
5358
msg = "not an FLI/FLC file"
5459
raise SyntaxError(msg)
5560

0 commit comments

Comments
 (0)