Crop VNC update requests to avoid segfaults, by Thomas Tuttle.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2741 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									2abec30bcf
								
							
						
					
					
						commit
						cf2d385c43
					
				
							
								
								
									
										9
									
								
								vnc.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								vnc.c
									
									
									
									
									
								
							@ -852,6 +852,15 @@ static void framebuffer_update_request(VncState *vs, int incremental,
 | 
				
			|||||||
				       int x_position, int y_position,
 | 
									       int x_position, int y_position,
 | 
				
			||||||
				       int w, int h)
 | 
									       int w, int h)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (x_position > vs->ds->width)
 | 
				
			||||||
 | 
					        x_position = vs->ds->width;
 | 
				
			||||||
 | 
					    if (y_position > vs->ds->height)
 | 
				
			||||||
 | 
					        y_position = vs->ds->height;
 | 
				
			||||||
 | 
					    if (x_position + w >= vs->ds->width)
 | 
				
			||||||
 | 
					        w = vs->ds->width  - x_position;
 | 
				
			||||||
 | 
					    if (y_position + h >= vs->ds->height)
 | 
				
			||||||
 | 
					        h = vs->ds->height - y_position;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
    vs->need_update = 1;
 | 
					    vs->need_update = 1;
 | 
				
			||||||
    if (!incremental) {
 | 
					    if (!incremental) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user