diff options
Diffstat (limited to 'core/qmpmidiread.cpp')
-rw-r--r-- | core/qmpmidiread.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp index e7d92d3..d5f20ff 100644 --- a/core/qmpmidiread.cpp +++ b/core/qmpmidiread.cpp @@ -100,7 +100,8 @@ int CSMFReader::eventReader()//returns 0 if End of Track encountered break; case 0x59://Key signature assert(len==2); - p1=(str[0]&0xffu)<<8u|(str[1]&0xffu); + if(len>=2) + p1=(str[0]&0xffu)<<8u|(str[1]&0xffu);else p1=0; curTrack->appendEvent(SEvent(curid,curt,type,metatype,p1)); break; case 0x01:case 0x02:case 0x03: |