summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-26 16:50:03 +0000
committerTim Angus <tim@ngus.net>2013-03-27 11:33:16 +0000
commitecf45acd236aaf1a0d2b00a94a24d8f24fbceae4 (patch)
tree23d703104aa48a4533daed653d5c429f73dccb05 /src/client
parenta6e5804c1162832fa99d31c88033cbf6f1efd2f0 (diff)
Fix some of the things clang --analyze flagged
Diffstat (limited to 'src/client')
-rw-r--r--src/client/snd_adpcm.c2
-rw-r--r--src/client/snd_dma.c1
-rw-r--r--src/client/snd_mix.c2
-rw-r--r--src/client/snd_openal.c2
-rw-r--r--src/client/snd_wavelet.c6
5 files changed, 5 insertions, 8 deletions
diff --git a/src/client/snd_adpcm.c b/src/client/snd_adpcm.c
index 89e68f42..4e138726 100644
--- a/src/client/snd_adpcm.c
+++ b/src/client/snd_adpcm.c
@@ -310,7 +310,7 @@ void S_AdpcmEncodeSound( sfx_t *sfx, short *samples ) {
newchunk = SND_malloc();
if (sfx->soundData == NULL) {
sfx->soundData = newchunk;
- } else {
+ } else if (chunk != NULL) {
chunk->next = newchunk;
}
chunk = newchunk;
diff --git a/src/client/snd_dma.c b/src/client/snd_dma.c
index e0e6988c..8aca94ce 100644
--- a/src/client/snd_dma.c
+++ b/src/client/snd_dma.c
@@ -1468,7 +1468,6 @@ void S_UpdateBackgroundTrack( void ) {
r = S_CodecReadStream(s_backgroundStream, fileBytes, raw);
if(r < fileBytes)
{
- fileBytes = r;
fileSamples = r / (s_backgroundStream->info.width * s_backgroundStream->info.channels);
}
diff --git a/src/client/snd_mix.c b/src/client/snd_mix.c
index 71cfd781..682e03ce 100644
--- a/src/client/snd_mix.c
+++ b/src/client/snd_mix.c
@@ -599,7 +599,7 @@ void S_PaintChannelFromMuLaw( channel_t *ch, sfx_t *sc, int count, int sampleOff
samp[i].left += (data * leftvol)>>8;
samp[i].right += (data * rightvol)>>8;
samples++;
- if (samples == (byte *)chunk->sndChunk+(SND_CHUNK_SIZE*2)) {
+ if (chunk != NULL && samples == (byte *)chunk->sndChunk+(SND_CHUNK_SIZE*2)) {
chunk = chunk->next;
samples = (byte *)chunk->sndChunk;
}
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index 01207a87..629f8921 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -2515,8 +2515,6 @@ qboolean S_AL_Init( soundInterface_t *si )
devicelist += curlen + 1;
}
}
- else
- devicelist = "";
s_alAvailableDevices = Cvar_Get("s_alAvailableDevices", devicenames, CVAR_ROM | CVAR_NORESTART);
}
diff --git a/src/client/snd_wavelet.c b/src/client/snd_wavelet.c
index 1355fcbe..51624614 100644
--- a/src/client/snd_wavelet.c
+++ b/src/client/snd_wavelet.c
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
void daub4(float b[], unsigned long n, int isign)
{
- float wksp[4097];
+ float wksp[4097] = { 0.0f };
float *a=b-1; // numerical recipies so a[1] = b[0]
unsigned long nh,nh1,i,j;
@@ -147,7 +147,7 @@ void encodeWavelet( sfx_t *sfx, short *packets) {
newchunk = SND_malloc();
if (sfx->soundData == NULL) {
sfx->soundData = newchunk;
- } else {
+ } else if (chunk != NULL) {
chunk->next = newchunk;
}
chunk = newchunk;
@@ -216,7 +216,7 @@ void encodeMuLaw( sfx_t *sfx, short *packets) {
newchunk = SND_malloc();
if (sfx->soundData == NULL) {
sfx->soundData = newchunk;
- } else {
+ } else if (chunk != NULL) {
chunk->next = newchunk;
}
chunk = newchunk;