From 6d15142a1fbde7e9b548e2e5a3976edd46c12ce2 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 29 Dec 2025 15:18:13 +1100 Subject: [PATCH] Assert fp is not None --- src/PIL/VtfImagePlugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PIL/VtfImagePlugin.py b/src/PIL/VtfImagePlugin.py index fc190f850..017eee747 100644 --- a/src/PIL/VtfImagePlugin.py +++ b/src/PIL/VtfImagePlugin.py @@ -184,6 +184,7 @@ class VtfImageFile(ImageFile.ImageFile): format_description = "Valve Texture Format" def _open(self): + assert self.fp is not None if not _accept(self.fp.read(12)): msg = "not a VTF file" raise SyntaxError(msg)