From bd5f1b9ea18dfe9fc61563274a8f893827a42ca8 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Mon, 5 Jun 2023 05:44:48 +0200 Subject: [PATCH] Fix uninitialized variable "pCurPreset" (#6639) (#6723) Fix the uninitialized variable pCurPreset by setting it to nullptr. Please note that it looks as if the nullptr is now being passed to the function fluid_sfont_iteration_next_wrapper. However, the function does not use the parameter anyway and then the variable is set to the result of that function. --- plugins/Sf2Player/PatchesDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index 9c9a689a0..c3ffe2d29 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -154,7 +154,7 @@ void PatchesDialog::setup ( fluid_synth_t * pSynth, int iChan, fluid_preset_t preset; fluid_preset_t *pCurPreset = &preset; #else - fluid_preset_t *pCurPreset; + fluid_preset_t *pCurPreset = nullptr; #endif while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset))) { int iBank = fluid_preset_get_banknum(pCurPreset);