From 175a471e5e5aeb4578ac3fc25863f573850e27ed Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 17 Mar 2019 23:38:34 -0400 Subject: [PATCH] actually limit mic samples to 254 --- desmume/src/frontend/windows/mic-win.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desmume/src/frontend/windows/mic-win.cpp b/desmume/src/frontend/windows/mic-win.cpp index 491a51dfc..faf4757e0 100644 --- a/desmume/src/frontend/windows/mic-win.cpp +++ b/desmume/src/frontend/windows/mic-win.cpp @@ -261,7 +261,9 @@ bool LoadSamples(const char *name) prefix.resize(maybe0-name); //if found, it's a wildcard. load all those samples - for(int i=0;;i++) + //this is limited to 254 entries in order to prevent some surprises, because I was stupid and used a byte for the MicSampleSelection. + //I should probably change that. But it has to be limited somehow... + for(int i=0;i<255;i++) { char tmp[32]; sprintf(tmp,"%d",i);