Xenakios / Atelier

Plugin for VCV Rack
Other
42 stars 2 forks source link

Fix out of bounds access #17

Closed falkTX closed 2 years ago

falkTX commented 2 years ago

Reported by GCC9 under Linux

Atelier/eurorack/plaits/dsp/engine/chord_engine.cc: In member function 'Atelierplaits::ChordEngine::Reset()':
Atelier/eurorack/plaits/dsp/engine/chord_engine.cc:69:70: error: iteration 4 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
   69 |       ratios_[i * kChordNumVoices + j] = SemitonesToRatio(chords[i][j]);
      |                                                           ~~~~~~~~~~~^
Atelier/eurorack/plaits/dsp/engine/chord_engine.cc:68:23: note: within this loop
   68 |     for (int j = 0; j < kChordNumVoices; ++j) {
      |                     ~~^~~~~~~~~~~~~~~~~

I took the fixes from the upstream repo, based on https://github.com/pichenettes/eurorack/commit/99432f2bf443219b3eb77e65e1a18583faad422e