fixed uninitialized memory issues in audio code
This commit is contained in:
parent
c2532bffb3
commit
3514a87b37
@ -22,7 +22,7 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
|
|||||||
//printf("update, loops %i, read ofs %i\n", (int)loops, read_ofs);
|
//printf("update, loops %i, read ofs %i\n", (int)loops, read_ofs);
|
||||||
//printf("playing %i, paused %i\n", (int)playing, (int)paused);
|
//printf("playing %i, paused %i\n", (int)playing, (int)paused);
|
||||||
|
|
||||||
if (!active || !playing || paused || !data.size())
|
if (!active || !playing || !data.size())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -490,6 +490,8 @@ AudioStreamPlaybackSpeex::AudioStreamPlaybackSpeex() {
|
|||||||
stream_channels=1;
|
stream_channels=1;
|
||||||
stream_srate=1;
|
stream_srate=1;
|
||||||
stream_minbuff_size=1;
|
stream_minbuff_size=1;
|
||||||
|
playing=false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ class AudioStreamPlaybackSpeex : public AudioStreamPlayback {
|
|||||||
bool loops;
|
bool loops;
|
||||||
int page_size;
|
int page_size;
|
||||||
bool playing;
|
bool playing;
|
||||||
bool paused;
|
|
||||||
bool packets_available;
|
bool packets_available;
|
||||||
|
|
||||||
void unload();
|
void unload();
|
||||||
|
@ -765,6 +765,10 @@ AudioMixer::ChannelID AudioMixerSW::channel_alloc(RID p_sample) {
|
|||||||
c.mix.increment=1;
|
c.mix.increment=1;
|
||||||
//zero everything when this errors
|
//zero everything when this errors
|
||||||
for(int i=0;i<4;i++) {
|
for(int i=0;i<4;i++) {
|
||||||
|
c.mix.vol[i]=0;
|
||||||
|
c.mix.reverb_vol[i]=0;
|
||||||
|
c.mix.chorus_vol[i]=0;
|
||||||
|
|
||||||
c.mix.old_vol[i]=0;
|
c.mix.old_vol[i]=0;
|
||||||
c.mix.old_reverb_vol[i]=0;
|
c.mix.old_reverb_vol[i]=0;
|
||||||
c.mix.old_chorus_vol[i]=0;
|
c.mix.old_chorus_vol[i]=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user