mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-30 23:47: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: |         else: | ||||||
|             raise IOError("Unsupported BMP header type (%d)" % len(s)) |             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: |         if not colors: | ||||||
|             colors = 1 << bits |             colors = 1 << bits | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user