mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Merge pull request #31 from cgohlke/patch-1
Make FLI image detection more stringent
This commit is contained in:
		
						commit
						88a7672163
					
				| 
						 | 
				
			
			@ -48,7 +48,9 @@ class FliImageFile(ImageFile.ImageFile):
 | 
			
		|||
        # HEAD
 | 
			
		||||
        s = self.fp.read(128)
 | 
			
		||||
        magic = i16(s[4:6])
 | 
			
		||||
        if magic not in [0xAF11, 0xAF12]:
 | 
			
		||||
        if not (magic in [0xAF11, 0xAF12] and
 | 
			
		||||
                i16(s[14:16]) in [0, 3] and  # flags
 | 
			
		||||
                s[20:22] == '\x00\x00'):  # reserved
 | 
			
		||||
            raise SyntaxError, "not an FLI/FLC file"
 | 
			
		||||
 | 
			
		||||
        # image characteristics
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user