From 786e448f165d2a32560982785078ae6ce96bd6ad Mon Sep 17 00:00:00 2001 From: Nev3r Date: Wed, 15 Apr 2020 10:17:14 +0200 Subject: [PATCH] Do not add -1 to the global taglists. --- src/taglist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/taglist.c b/src/taglist.c index f00f62ca4..fcce7adc3 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -25,6 +25,10 @@ boolean Tag_Compare (const taglist_t* list1, const taglist_t* list2) void Taglist_AddToSectors (const size_t tag, const size_t itemid) { taggroup_t* tagelems; + + if (tag == -1) + return; + if (!tags_sectors[tag]) tags_sectors[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); @@ -40,6 +44,9 @@ void Taglist_AddToLines (const size_t tag, const size_t itemid) if (!tags_lines[tag]) tags_lines[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); + if (tag == -1) + return; + tagelems = tags_lines[tag]; tagelems->count++; tagelems->elements = Z_Realloc(tagelems->elements, tagelems->count * sizeof(size_t), PU_LEVEL, NULL); @@ -52,6 +59,9 @@ void Taglist_AddToMapthings (const size_t tag, const size_t itemid) if (!tags_mapthings[tag]) tags_mapthings[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); + if (tag == -1) + return; + tagelems = tags_mapthings[tag]; tagelems->count++; tagelems->elements = Z_Realloc(tagelems->elements, tagelems->count * sizeof(size_t), PU_LEVEL, NULL);