mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Release buffer on error
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
This commit is contained in:
		
							parent
							
								
									b970eb9e5d
								
							
						
					
					
						commit
						494a3bcf2b
					
				| 
						 | 
				
			
			@ -202,6 +202,7 @@ _frombytes(ImagingDisplayObject *display, PyObject *args) {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    if (display->dib->ysize * display->dib->linesize != buffer.len) {
 | 
			
		||||
        PyBuffer_Release(&buffer);
 | 
			
		||||
        PyErr_SetString(PyExc_ValueError, "wrong size");
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user