From 4d55c0185f2739b1337f0644d7e3dfc6f96d6a69 Mon Sep 17 00:00:00 2001 From: Adam Jensen Date: Sun, 9 Apr 2023 17:37:27 +0100 Subject: [PATCH] fix out-of-bounds accesses in DrawableList::draw --- rendering/RenderPasses.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rendering/RenderPasses.cpp b/rendering/RenderPasses.cpp index 8c045b1..aa5702f 100644 --- a/rendering/RenderPasses.cpp +++ b/rendering/RenderPasses.cpp @@ -168,7 +168,7 @@ void DrawableList::draw(RenderFunctionSet *funcSet, uint32_t funcSetIndex) { bool matchPrev = prev && prev->typeID == drawable->typeID && prev->getVtable() == drawable->getVtable(); - funcSet->func[drawable->typeID](funcSetIndex, drawable, prev); + funcSet->func[drawable->typeID](funcSetIndex, drawable, matchPrev ? prev : nullptr); item = item->next; } }