mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	Add bounds check for X (#1371)
Avoid crash if a draw goes to a negative X position.
This commit is contained in:
		| @@ -132,7 +132,7 @@ void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, Color colo | ||||
|     this->max_displaybuffer_.resize(x + 1, this->bckgrnd_); | ||||
|   } | ||||
|  | ||||
|   if (y >= this->get_height_internal() || y < 0)  // If pixel is outside display then dont draw | ||||
|   if ((y >= this->get_height_internal()) || (y < 0) || (x < 0))  // If pixel is outside display then dont draw | ||||
|     return; | ||||
|  | ||||
|   uint16_t pos = x;    // X is starting at 0 top left | ||||
|   | ||||
		Reference in New Issue
	
	Block a user