[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program change
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- audio-video-rtc
Research direction
Start in juce_audio_plugin_client_VST3.cpp at IMidiMapping::getMidiControllerAssignment and trace how MIDI controller indices are checked against midiControllerToParameter. Check the VST3 program parameter lookup, including the reported channel and controller boundaries. Done when program changes map to getProgramParamID() where available and invalid indices return kResultFalse; exercise the behavior for channels 0–15.
Written by the indexing model from the issue text.
Description
Detailed steps on how to reproduce the bug
With JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS on (the default), a host that asks the VST3 controller which parameter handles MIDI program change calls IMidiMapping::getMidiControllerAssignment (bus, channel, Vst::kCtrlProgramChange, id).
juce_audio_plugin_client_VST3.cpp answers with midiControllerToParameter[channel][midiControllerNumber] and no range check. The table is [numMIDIChannels][Vst::kCountCtrlNumber], kCountCtrlNumber is 130 and kCtrlProgramChange is also 130, so this reads one past the end of the row: you get the CC 0 parameter of the next channel, and on channel 16 it reads past the whole array. The host then sends program changes to that parameter, so they never reach the plugin's program parameter.
To reproduce, load any JUCE VST3 with a few programs (the demo plugin works), get its IMidiMapping and call getMidiControllerAssignment (0, ch, Vst::kCtrlProgramChange, id) for ch 0..15. You get the bank select parameter of channel ch+1 instead of the program parameter, and garbage on channel 15. A user hit this in Reaper, where MIDI CC reaches the plugin but program change never does.
What is the expected behaviour?
Program change maps to the program parameter (getProgramParamID()) when the plugin has programs, and any channel or controller number outside the table returns kResultFalse instead of reading out of bounds.
Operating systems
Windows, macOS, Linux
What versions of the operating systems?
All, it's not OS specific.
Architectures
x86_64, ARM
Stacktrace
No crash, it's a silent out-of-bounds read in getMidiControllerAssignment.
Plug-in formats (if applicable)
VST3
Plug-in host applications (DAWs) (if applicable)
REAPER
Testing on the develop branch
The bug is present on the develop branch
Code of Conduct
- I agree to follow the Code of Conduct
I patched around it in the plugin where I hit it: https://github.com/tone-3000/tone3000-plugin/pull/306
- Dominant language
- C++
- Stars
- 8.9k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from juce-framework/JUCE
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
juce-framework/JUCE#1805 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
juce-framework/JUCE#1804 ·
-
[Bug]: Linux: an embedded window's vblank rate comes from the display at its parent-relative boundsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
juce-framework/JUCE#1800 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
juce-framework/JUCE#1795 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
juce-framework/JUCE#1790 ·
All issues in juce-framework/JUCE
Similar issues
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ClickHouse/ClickHouse#132519 ·
Maintainers usually reply within 1 day
-
patch_advisor_json_integration fails when the build tree is reached through a symbolic linkPossibly taken @DerKarussellbremser claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
boykopovar/AnyPS5#22581 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
petercorke/robotics-toolbox-python#952 ·
Maintainers usually reply within 1 day
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusOpenfunc:engine type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#1276 ·
Maintainers usually reply within 1 day