From d112cd0c68f26ed21657d063c540cfc6b86d1042 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 3 Apr 2022 17:22:44 -0500 Subject: [PATCH] what? --- src/engine/fileOps.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 619591209..4e758c2de 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -259,7 +259,9 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) { // instruments in ancient versions were all FM or STD. ins->mode=1; } else { - ins->mode=reader.readC(); + unsigned char mode=reader.readC(); + if (mode>1) logW("%d: invalid instrument mode %d!\n",i,mode); + ins->mode=mode; } ins->type=ins->mode?DIV_INS_FM:DIV_INS_STD; if (ds.system[0]==DIV_SYSTEM_GB) {