Unverified Commit 2e3905e5 authored by Wolle's avatar Wolle Committed by GitHub

Fix one more memory leak in the Vorbis Decoder #623

parent 71b75236
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* adapted for the ESP32 by schreibfaul1 * adapted for the ESP32 by schreibfaul1
* *
* Created on: 13.02.2023 * Created on: 13.02.2023
* Updated on: 04.12.2023 * Updated on: 12.12.2023
*/ */
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// O G G I M P L. // O G G I M P L.
...@@ -123,12 +123,7 @@ void VORBISDecoder_FreeBuffers(){ ...@@ -123,12 +123,7 @@ void VORBISDecoder_FreeBuffers(){
if(s_map_param){free(s_map_param); s_map_param = NULL;} if(s_map_param){free(s_map_param); s_map_param = NULL;}
if(s_mode_param) {free(s_mode_param); s_mode_param = NULL;}
if(s_mode_param) {
if(s_mode_param){free(s_mode_param); s_mode_param = NULL;}
}
if(s_dsp_state){vorbis_dsp_destroy(s_dsp_state); s_dsp_state = NULL;} if(s_dsp_state){vorbis_dsp_destroy(s_dsp_state); s_dsp_state = NULL;}
} }
...@@ -146,7 +141,8 @@ void VORBISsetDefaults(){ ...@@ -146,7 +141,8 @@ void VORBISsetDefaults(){
s_f_oggFirstPage = false; s_f_oggFirstPage = false;
s_f_oggContinuedPage = false; s_f_oggContinuedPage = false;
s_f_oggLastPage = false; s_f_oggLastPage = false;
s_vorbisChannels = 0; if(s_dsp_state){vorbis_dsp_destroy(s_dsp_state); s_dsp_state = NULL;}
// s_vorbisChannels = 0;
s_vorbisSamplerate = 0; s_vorbisSamplerate = 0;
s_vorbisBitRate = 0; s_vorbisBitRate = 0;
s_vorbisSegmentLength = 0; s_vorbisSegmentLength = 0;
...@@ -1669,7 +1665,6 @@ void vorbis_dsp_destroy(vorbis_dsp_state_t *v) { ...@@ -1669,7 +1665,6 @@ void vorbis_dsp_destroy(vorbis_dsp_state_t *v) {
} }
if(v->mdctright){free(v->mdctright); v->mdctright = NULL;} if(v->mdctright){free(v->mdctright); v->mdctright = NULL;}
} }
if(v){free(v); v = NULL;}
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment