Ableton jassert fails because of getCurrentPosition(...)

This is not a major issue but it is quite annoying. These are the steps to reproduce it.

System: Windows 7, Ableton Live 8.2.2

  1. I add code in the processBlock method of my plugin to retrieve bpm, signature and so forth:

AudioPlayHead::CurrentPositionInfo pos; if (getPlayHead() != 0 && getPlayHead()->getCurrentPosition(pos) && pos.isPlaying)

  1. I run the plugin in Ableton in debugging mode. I click on play and then twice on stop on the tranport bar. A breakpoint is triggered.

  2. The following jassert fails:
    modules\juce_audio_plugin_client\VST\juce_VST_Wrapper.cpp(Line 569)

while (i.getNextEvent (midiEventData, midiEventSize, midiEventPosition))
  jassert (midiEventPosition >= 0 && midiEventPosition < numSamples);

jassert breaks because midiEventPosition = numSamples

I don’t understand why it happens though. Is the host sending MIDI in response to the getCurrentPosition(pos) request?
I suspect it is a bug from Ableton since it doesn’t happen with other hosts. Can anybody confirm?

Could just be a rounding error in the host’s timing. Or perhaps they’re assuming it’s ok for the sample number to be <= the buffer size, whereas I’m assuming it should be < buffer size. Not a big deal if you ignore it, or you could change the assertion if it’s bothering you.