[MIDI Input] No longer crash when seeking to the end
When seeking to the end of a file, no longer crash due to out of range std::vector access, because it was using at() with an offset of the array size. Instead, offset from the begin() iterator return value, which allows offsetting to end(). Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
321e3382f4
commit
a847cbde3b
|
@ -266,7 +266,7 @@ void MIDIPlayer::Seek(unsigned long sample) {
|
|||
|
||||
if(uStreamPosition > stream_start) {
|
||||
filler.resize(uStreamPosition - stream_start);
|
||||
filler.assign(&mStream.at(stream_start), &mStream.at(uStreamPosition));
|
||||
filler.assign(mStream.begin() + stream_start, mStream.begin() + uStreamPosition);
|
||||
|
||||
unsigned long i, j;
|
||||
|
||||
|
|
Loading…
Reference in New Issue