From a994d7c050898ad13d509871d5ea353a1da2d3da Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Nov 2025 21:59:10 +0100 Subject: [PATCH 1/2] G_DoPlayDemo: fix maybe unitialized warning in this case this wouldve been fine, tho variables using the cleanup macro should always be initzialized for safety --- src/g_demo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_demo.c b/src/g_demo.c index 5e6f20a6d..c670f69cd 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -2536,7 +2536,7 @@ void G_DoPlayDemo(char *defdemoname) UINT8 i, p; lumpnum_t l; char skin[17], color[17], *n; - CLEANUP(Z_Pfree) char *pdemoname; + CLEANUP(Z_Pfree) char *pdemoname = NULL; UINT8 version, subversion; UINT32 randseed; char msg[1024]; From 7ab8bf1bbf0835e6a2e0f5320df90502abce4f3a Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 18 Nov 2025 12:20:27 +0300 Subject: [PATCH 2/2] Emotes: only print 'too many frames' warning if we actually get non-empty frame --- src/m_emotes.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/m_emotes.cpp b/src/m_emotes.cpp index 45fd78804..d12f28dfb 100644 --- a/src/m_emotes.cpp +++ b/src/m_emotes.cpp @@ -117,12 +117,6 @@ void M_LoadEmotes(UINT16 wadnum) UINT8 numframes = 0; auto copy_frame = [&] { - if (numframes == MAXEMOTEFRAMES) - { - CONS_Alert(CONS_WARNING, "EMOTES: Too many frames. (file %s, line %d)", wadfiles[wadnum]->filename, linenum); - return false; - } - size_t list_split = value.find(','); std::string framelumpname = value.substr(0, list_split); trim(framelumpname); @@ -136,6 +130,13 @@ void M_LoadEmotes(UINT16 wadnum) if (framelumpname.size() == 0) return false; + // Only print this warning if we actually got new frame + if (numframes == MAXEMOTEFRAMES) + { + CONS_Alert(CONS_WARNING, "EMOTES: Too many frames. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum); + return false; + } + if (framelumpname.size() > 8) { CONS_Alert(CONS_WARNING, "EMOTES: Frame %d name is too long. (file %s, line %d)", numframes, wadfiles[wadnum]->filename, linenum);