Fixed array length mismatch bug

A bug that sometimes occurred when the event extended past the end of
the source audio.