Skip to content

Commit 9bd41d4

Browse files
committed
Match against all 8 PNG file signature bytes
1 parent 0c7f219 commit 9bd41d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

filetype/types/image.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ def match(self, buf):
137137
buf[0] == 0x89 and
138138
buf[1] == 0x50 and
139139
buf[2] == 0x4E and
140-
buf[3] == 0x47)
141-
140+
buf[3] == 0x47 and
141+
buf[4] == 0x0D and
142+
buf[5] == 0x0A and
143+
buf[6] == 0x1A and
144+
buf[7] == 0x0A)
142145

143146
class Gif(Type):
144147
"""

0 commit comments

Comments
 (0)