When running the code below in debug config, System::getDriverInfo()
corrupts i
. In the first loop i
is 0
but after calling the function i
is some bogus value 673198133
. Note that all other output params give correct output.
FMOD::Studio::System* system{ nullptr };
ERRCHECK(FMOD::Studio::System::create(&system));
FMOD::System* core{ nullptr };
ERRCHECK(system->getCoreSystem(&core));
int num_drivers{};
ERRCHECK(core->getNumDrivers(&num_drivers));
for (int i = 0; i < num_drivers; ++i) {
char name{};
constexpr int kNameLength{ 256 };
FMOD_GUID guid{};
int system_rate{};
FMOD_SPEAKERMODE mode{};
int speaker_mode_channels{};
ERRCHECK(core->getDriverInfo(i, &name, kNameLength, &guid, &system_rate, &mode, &speaker_mode_channels));
}