From 02199ec016c24aceb0a7bd0b53af0151548b6270 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Tue, 27 Apr 2021 16:20:52 -0700 Subject: [PATCH] Fix crash in voices.c:SetVoiceScores The only way (in Dec. 2019) to get espeak_ListVoices to actually list all the voices, including variants and mbrola voices used to be to pass a non-null voice selector with a null language pointer. This still seems to be supported in SetVoiceScores, which still checks for a null language (see the check right at the top), however new code has been added for a pseudo voice "all" lower down which seems to do the same thing but crashes with null. This change allows "old" code to continue working. Signed-off-by: John Bowler --- src/libespeak-ng/voices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index d0e368bb..36a4d13e 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -1155,7 +1155,7 @@ static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int if (((control & 1) == 0) && (memcmp(vp->identifier, "mb/", 3) == 0)) continue; - if (memcmp(voice_select->languages,"all", 3) == 0) { + if (voice_select->languages == NULL || memcmp(voice_select->languages,"all", 3) == 0) { voices[nv++] = vp; continue; }