Skip to content

Commit fbaaf3c

Browse files
committed
Do not read data until necessary
1 parent 6b9b392 commit fbaaf3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PIL/GbrImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class GbrImageFile(ImageFile.ImageFile):
4343

4444
def _open(self):
4545
header_size = i32(self.fp.read(4))
46-
version = i32(self.fp.read(4))
4746
if header_size < 20:
4847
raise SyntaxError("not a GIMP brush")
48+
version = i32(self.fp.read(4))
4949
if version not in (1, 2):
5050
raise SyntaxError(f"Unsupported GIMP brush version: {version}")
5151

0 commit comments

Comments
 (0)