From 3e380309cee96eeec698ae500a1f86a589cfd143 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 10 Oct 2018 19:14:56 +0000 Subject: [PATCH] Replace error condition in rejectQueue_remove() with an assertion, because the NULL pointer it would return if something was fucked up would be unconditionally dereferenced in kdtree_add(). git-svn-id: https://svn.eduke32.com/eduke32@7058 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/tilepacker.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/build/src/tilepacker.cpp b/source/build/src/tilepacker.cpp index 731d683f0..5aafb1be5 100644 --- a/source/build/src/tilepacker.cpp +++ b/source/build/src/tilepacker.cpp @@ -260,10 +260,7 @@ static char rejectQueue_add(TreeNode *pNode) static TreeNode* rejectQueue_remove() { - if (numRejected == 0) - { - return NULL; - } + Bassert(numRejected); --numRejected; TreeNode* pNode = rejectQueue+rejectQueueHeadIndex;