summaryrefslogtreecommitdiffstats
path: root/src/common/tree.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-16 07:30:21 +0200
committerGitHub <noreply@github.com>2021-05-16 07:30:21 +0200
commit5a2b15bf75318987d773a2bc69bd6224a28b7939 (patch)
treef213f5b011410022e8e98f7c3905d16d575ed413 /src/common/tree.h
parentMerge pull request #6289 from ameerj/oob-blit (diff)
parentcommon: tree: Avoid a nullptr dereference. (diff)
downloadyuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.gz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.bz2
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.lz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.xz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.zst
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.zip
Diffstat (limited to 'src/common/tree.h')
-rw-r--r--src/common/tree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/tree.h b/src/common/tree.h
index 3da49e422..9d2d0df4e 100644
--- a/src/common/tree.h
+++ b/src/common/tree.h
@@ -322,7 +322,7 @@ void RB_INSERT_COLOR(RBHead<Node>* head, Node* elm) {
template <typename Node>
void RB_REMOVE_COLOR(RBHead<Node>* head, Node* parent, Node* elm) {
Node* tmp;
- while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root()) {
+ while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root() && parent != nullptr) {
if (RB_LEFT(parent) == elm) {
tmp = RB_RIGHT(parent);
if (RB_IS_RED(tmp)) {