From 63f82898470c5328f4de8fdb117c63c885521416 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 24 Jun 2024 04:01:08 -0500 Subject: [PATCH] IT import: fix empty asset loading --- src/engine/fileOps/it.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/engine/fileOps/it.cpp b/src/engine/fileOps/it.cpp index e3be8b09b..fe799ff6e 100644 --- a/src/engine/fileOps/it.cpp +++ b/src/engine/fileOps/it.cpp @@ -136,6 +136,12 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) { // read instruments for (int i=0; itype=DIV_INS_ES5506; + + if (insPtr[i]==0) { + ds.ins.push_back(ins); + continue; + } logV("reading instrument %d...",i); if (!reader.seek(insPtr[i],SEEK_SET)) { @@ -252,6 +258,11 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) { for (int i=0; iDIV_MAX_ROWS) { + logE("too many rows! %d",patRows); + lastError="too many rows"; + delete[] file; + return false; + } + reader.readI(); // x dataLen+=reader.tell();