aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qmpmidiread.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp
index 380b603..9b1d932 100644
--- a/core/qmpmidiread.cpp
+++ b/core/qmpmidiread.cpp
@@ -172,10 +172,13 @@ int CMidiFile::eventReader()//returns 0 if End of Track encountered
error(0,"W: Unknown event type %#x",type);
}
lasttype=type;++curid;
- SEvent* le=eventList[eventList.size()-1];
- SEventCallBackData cbd(le->type,le->p1,le->p2,le->time);
- for(int i=0;i<16;++i)if(eventReaderCB[i])
- eventReaderCB[i]->callBack(&cbd,eventReaderCBuserdata[i]);
+ if(eventList.size())
+ {
+ SEvent* le=eventList[eventList.size()-1];
+ SEventCallBackData cbd(le->type,le->p1,le->p2,le->time);
+ for(int i=0;i<16;++i)if(eventReaderCB[i])
+ eventReaderCB[i]->callBack(&cbd,eventReaderCBuserdata[i]);
+ }
return 1;
}
void CMidiFile::trackChunkReader()