From 5cce67a4b4d59ff1c75697a64e25ac8f5625d87d Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 26 Jun 2024 12:51:56 +0300 Subject: Fix loopsCount used uninitialized in LoopState::reset() Done by @noisecode3: https://github.com/Wohlstand/libOPNMIDI/commit/5767f32630ef22ae43f00d650793b6606823c8b0 --- src/midi_sequencer.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/midi_sequencer.hpp') diff --git a/src/midi_sequencer.hpp b/src/midi_sequencer.hpp index e6e9983..2c02fc9 100644 --- a/src/midi_sequencer.hpp +++ b/src/midi_sequencer.hpp @@ -457,6 +457,13 @@ private: //! Current level on the loop stack (<0 - out of loop, 0++ - the index in the loop stack) int stackLevel; + //! Constructor to initialize member variables + LoopState() + : caughtStart(false), caughtEnd(false), caughtStackStart(false), + caughtStackEnd(false), caughtStackBreak(false), skipStackStart(false), + invalidLoop(false), temporaryBroken(false), loopsCount(-1), loopsLeft(0), + stackLevel(-1) + {} /** * @brief Reset loop state to initial */ -- cgit v1.2.3