mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-11-04 01:34:38 +00:00 
			
		
		
		
	SDL_GetDisplayForPoint(), SDL_GetDisplayForRect(): Check argument for NULL.
This commit is contained in:
		
				
					committed by
					
						
						Sam Lantinga
					
				
			
			
				
	
			
			
			
						parent
						
							8026866994
						
					
				
				
					commit
					73e0e8cf5b
				
			@@ -1594,11 +1594,21 @@ void SDL_GlobalToRelativeForWindow(SDL_Window *window, int abs_x, int abs_y, int
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SDL_DisplayID SDL_GetDisplayForPoint(const SDL_Point *point)
 | 
					SDL_DisplayID SDL_GetDisplayForPoint(const SDL_Point *point)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!point) {
 | 
				
			||||||
 | 
					        SDL_InvalidParamError("point");
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return GetDisplayForRect(point->x, point->y, 1, 1);
 | 
					    return GetDisplayForRect(point->x, point->y, 1, 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SDL_DisplayID SDL_GetDisplayForRect(const SDL_Rect *rect)
 | 
					SDL_DisplayID SDL_GetDisplayForRect(const SDL_Rect *rect)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!rect) {
 | 
				
			||||||
 | 
					        SDL_InvalidParamError("rect");
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return GetDisplayForRect(rect->x, rect->y, rect->w, rect->h);
 | 
					    return GetDisplayForRect(rect->x, rect->y, rect->w, rect->h);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user