mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 00:26:17 +00:00 
			
		
		
		
	Possible NULL pointer dereference.
This commit is contained in:
		
							parent
							
								
									ad49977f1b
								
							
						
					
					
						commit
						153d2454fc
					
				
							
								
								
									
										6
									
								
								clay.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								clay.h
									
									
									
									
									
								
							| 
						 | 
					@ -3706,10 +3706,10 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
 | 
				
			||||||
            Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
 | 
					            Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
 | 
				
			||||||
            int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
 | 
					            int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
 | 
				
			||||||
            Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
 | 
					            Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
 | 
				
			||||||
            Clay_BoundingBox elementBox = mapItem->boundingBox;
 | 
					 | 
				
			||||||
            elementBox.x -= root->pointerOffset.x;
 | 
					 | 
				
			||||||
            elementBox.y -= root->pointerOffset.y;
 | 
					 | 
				
			||||||
            if (mapItem) {
 | 
					            if (mapItem) {
 | 
				
			||||||
 | 
					                Clay_BoundingBox elementBox = mapItem->boundingBox;
 | 
				
			||||||
 | 
					                elementBox.x -= root->pointerOffset.x;
 | 
				
			||||||
 | 
					                elementBox.y -= root->pointerOffset.y;
 | 
				
			||||||
                if ((Clay__PointIsInsideRect(position, elementBox)) && (clipElementId == 0 || (Clay__PointIsInsideRect(position, clipItem->boundingBox)))) {
 | 
					                if ((Clay__PointIsInsideRect(position, elementBox)) && (clipElementId == 0 || (Clay__PointIsInsideRect(position, clipItem->boundingBox)))) {
 | 
				
			||||||
                    if (mapItem->onHoverFunction) {
 | 
					                    if (mapItem->onHoverFunction) {
 | 
				
			||||||
                        mapItem->onHoverFunction(mapItem->elementId, context->pointerInfo, mapItem->hoverFunctionUserData);
 | 
					                        mapItem->onHoverFunction(mapItem->elementId, context->pointerInfo, mapItem->hoverFunctionUserData);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue