mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 07:57:27 +03:00 
			
		
		
		
	Fixed DOS with invalid BMP size entries
This commit is contained in:
		
							parent
							
								
									3ea93e5de5
								
							
						
					
					
						commit
						88d0e6080a
					
				|  | @ -99,6 +99,10 @@ class BmpImageFile(ImageFile.ImageFile): | |||
|         else: | ||||
|             raise IOError("Unsupported BMP header type (%d)" % len(s)) | ||||
| 
 | ||||
|         if (self.size[0]*self.size[1]) > 2**31: | ||||
|             # Prevent DOS for > 2gb images | ||||
|             raise IOError("Unsupported BMP Size: (%dx%d)" % self.size) | ||||
| 
 | ||||
|         if not colors: | ||||
|             colors = 1 << bits | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user