engine: platform: always create zeroed buffer for audio

This commit is contained in:
Alibek Omarov 2025-02-14 05:20:40 +03:00
parent 89430400d9
commit 0e2abf9040
2 changed files with 2 additions and 2 deletions

View file

@ -184,7 +184,7 @@ qboolean SNDDMA_Init( void )
return false;
}
dma.buffer = Mem_Malloc( sndpool, samples * 2 ); //allocate pcm frame buffer
dma.buffer = Mem_Calloc( sndpool, samples * 2 ); //allocate pcm frame buffer
dma.samplepos = 0;
dma.samples = samples;
dma.format.width = 2;

View file

@ -175,7 +175,7 @@ qboolean SNDDMA_Init( void )
if( !samplecount )
samplecount = 0x8000;
dma.samples = samplecount * obtained.channels;
dma.buffer = Mem_Malloc( sndpool, dma.samples * 2 );
dma.buffer = Mem_Calloc( sndpool, dma.samples * 2 );
dma.samplepos = 0;
sdl_format = obtained.format;