Bug 1221520 - nullcheck for mSpeechdClient. r=eeejay
--- a/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
+++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
@@ -339,16 +339,20 @@ SpeechDispatcherService::Init()
if (!*kSpeechDispatcherSymbols[i].function) {
NS_WARNING(nsPrintfCString("Failed to find speechd symbol for'%s'",
kSpeechDispatcherSymbols[i].functionName).get());
return;
}
}
mSpeechdClient = spd_open("firefox", "web speech api", "who", SPD_MODE_THREADED);
+ if (!mSpeechdClient) {
+ NS_WARNING("Failed to call spd_open");
+ return;
+ }
// Get all the voices from sapi and register in the SynthVoiceRegistry
SPDVoice** list = spd_list_synthesis_voices(mSpeechdClient);
mSpeechdClient->callback_begin = speechd_cb;
mSpeechdClient->callback_end = speechd_cb;
mSpeechdClient->callback_cancel = speechd_cb;
mSpeechdClient->callback_pause = speechd_cb;