From 4d93465072f18150617885d561ff6385bae292bd Mon Sep 17 00:00:00 2001 From: veplaini Date: Tue, 7 Mar 2017 13:13:33 +0000 Subject: [PATCH] more coverity issues again --- Opcodes/sfont.c | 4 +++- frontends/CsoundAC/allegro.cpp | 1 + frontends/csladspa/csladspa.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Opcodes/sfont.c b/Opcodes/sfont.c index 372ced55931..3b7b8a26eaf 100644 --- a/Opcodes/sfont.c +++ b/Opcodes/sfont.c @@ -2002,8 +2002,10 @@ static int chunk_read(CSOUND *csound, FILE *fil, CHUNK *chunk) { if (UNLIKELY(4 != fread(chunk->ckID,1,4, fil))) return 0; - if (UNLIKELY(1 != fread(&chunk->ckSize,4,1,fil))) + if (UNLIKELY(1 != fread(&chunk->ckSize,4,1,fil))) { + chunk->ckSize = 0; return 0; + } ChangeByteOrder("d", (char *)&chunk->ckSize, 4); chunk->ckDATA = (BYTE *) csound->Malloc(csound, chunk->ckSize); if (chunk->ckDATA==NULL) diff --git a/frontends/CsoundAC/allegro.cpp b/frontends/CsoundAC/allegro.cpp index 8560cadc608..fbcfb1a1069 100755 --- a/frontends/CsoundAC/allegro.cpp +++ b/frontends/CsoundAC/allegro.cpp @@ -2783,6 +2783,7 @@ bool Alg_iterator::remove_next(Alg_events_ptr &events, long &index, Alg_seq::Alg_seq(const char *filename, bool smf, double *offset_ptr) + : pending(), beat_x(0) { basic_initialization(); ifstream inf(filename, smf ? ios::binary | ios::in : ios::in); diff --git a/frontends/csladspa/csladspa.cpp b/frontends/csladspa/csladspa.cpp index c186789ea87..07bfd921172 100644 --- a/frontends/csladspa/csladspa.cpp +++ b/frontends/csladspa/csladspa.cpp @@ -428,7 +428,7 @@ unsigned int CountCSD(char **csdnames) src = getenv("LADSPA_PATH"); if (src) strncpy(ladspa_path, src, 1023); - ladspa_path[1023] = "\0"; + ladspa_path[1023] = '\0'; #endif // if no LADSPA_PATH attempt to open