mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	BUG fix: '' in image mode no longer causes a crash
This commit is contained in:
		
							parent
							
								
									851aa210df
								
							
						
					
					
						commit
						3ffcd9770c
					
				| 
						 | 
					@ -398,6 +398,9 @@ ImagingNew(const char* mode, int xsize, int ysize)
 | 
				
			||||||
    int bytes;
 | 
					    int bytes;
 | 
				
			||||||
    Imaging im;
 | 
					    Imaging im;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (strcmp(mode, "") == 0)
 | 
				
			||||||
 | 
					        return (Imaging) ImagingError_ValueError("empty mode");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (strlen(mode) == 1) {
 | 
					    if (strlen(mode) == 1) {
 | 
				
			||||||
        if (mode[0] == 'F' || mode[0] == 'I')
 | 
					        if (mode[0] == 'F' || mode[0] == 'I')
 | 
				
			||||||
            bytes = 4;
 | 
					            bytes = 4;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user