mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Merge pull request #782 from wiredfool/32bit_decompression
32bit mult overflow fix
This commit is contained in:
		
						commit
						3ad62fa7fc
					
				
							
								
								
									
										7
									
								
								Tests/32bit_segfault_test.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Tests/32bit_segfault_test.py
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
#!/usr/bin/env python
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
 | 
			
		||||
im = Image.new('L', (999999, 999999), 0)
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -69,4 +69,6 @@
 | 
			
		|||
#define	FLOAT32 float
 | 
			
		||||
#define	FLOAT64 double
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
typedef signed __int64       int64_t;
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -379,7 +379,7 @@ ImagingNew(const char* mode, int xsize, int ysize)
 | 
			
		|||
    } else
 | 
			
		||||
        bytes = strlen(mode); /* close enough */
 | 
			
		||||
 | 
			
		||||
    if ((Py_ssize_t) xsize * ysize * bytes <= THRESHOLD) {
 | 
			
		||||
    if ((int64_t) xsize * (int64_t) ysize * bytes <= THRESHOLD) {
 | 
			
		||||
        im = ImagingNewBlock(mode, xsize, ysize);
 | 
			
		||||
        if (im)
 | 
			
		||||
            return im;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user