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

This commit is contained in:
Michał Janiszewski 2024-05-07 06:21:27 +02:00 committed by GitHub
parent a611244b31
commit 11510a0e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

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;