From 19b2bebc0215bb64e743ab1976d9c560e5ec102f Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 13 Sep 2017 07:03:18 +0100 Subject: [PATCH] Don't save an intonation if it was not found. Clang static analysis reports an 'Assigned value is garbage or undefined' error. This happens if the default_tune data has not been copied in the kTUNE case. Extending this further, it does not make sense to save the tune data if the tune was not found, or if the tune already exists. --- src/libespeak-ng/compiledata.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 959f17d2..d58a2262 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -2825,6 +2825,7 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log, espeak_ng_ERROR_CONTEXT error("Bad tune name: '%s;", new_tune.name); break; case kENDTUNE: + if (!found) continue; if (done_onset == 0) { new_tune.unstr_start[0] = new_tune.unstr_start[1]; new_tune.unstr_end[0] = new_tune.unstr_end[1];