Guard against possible nullptr dereference when prefetching BBox (#21978)

This commit is contained in:
Michał Janiszewski authored and GitHub committed 2024-05-07 06:21:27 +02:00
1 parent a611244b31
commit 11510a0e0b
1 file changed
+4 -1
+4 -1
View File
@@ -391,7 +391,10 @@ template<uint8_t TRotation> static void PaintStructsSortQuadrant(PaintStruct* pa
auto* ps = child;
child = child->NextQuadrantEntry;
PREFETCH(&child->Bounds);
if (child != nullptr)
{
PREFETCH(&child->Bounds);
}
if (child == nullptr || child->SortFlags & PaintSortFlags::OutsideQuadrant)
{
break;