Commit e73c07ab authored by cfleizach@apple.com's avatar cfleizach@apple.com
Browse files

WebSpeech: crash at WebCore::SpeechSynthesis::speak

https://bugs.webkit.org/show_bug.cgi?id=113937

Reviewed by Tim Horton.

Source/WebCore:

Protect against the case when invalid data is passed in.

Test: platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::speak):
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::setVoice):

LayoutTests:

* platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt: Added.
* platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee2dcfba
2013-04-05 Chris Fleizach <cfleizach@apple.com>
WebSpeech: crash at WebCore::SpeechSynthesis::speak
https://bugs.webkit.org/show_bug.cgi?id=113937
Reviewed by Tim Horton.
* platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt: Added.
* platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html: Added.
2013-04-05 Rijubrata Bhaumik <rijubrata.bhaumik@intel.com>
 
[EFL] Enable indexed database
This tests that passing in the wrong type of data won't crash speech synthesis code
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="console"></div>
<script>
description("This tests that passing in the wrong type of data won't crash speech synthesis code");
// Don't crash. Speak is supposed to take an utterance, not a string.
speechSynthesis.speak('Hello World');
// Don't crash. An utterance voice is supposed to take a voice object, not a string.
var x = new SpeechSynthesisUtterance('Hello World');
x.voice = "asdf";
// Don't crash. An utterance is supposed to take a string, not a number.
x = new SpeechSynthesisUtterance(223);
</script>
<script src="../../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2013-04-05 Chris Fleizach <cfleizach@apple.com>
WebSpeech: crash at WebCore::SpeechSynthesis::speak
https://bugs.webkit.org/show_bug.cgi?id=113937
Reviewed by Tim Horton.
Protect against the case when invalid data is passed in.
Test: platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::speak):
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::setVoice):
2013-04-05 Antti Koivisto <antti@apple.com>
 
Throttle compositing layer flushes during page loading
......@@ -102,6 +102,9 @@ void SpeechSynthesis::startSpeakingImmediately(SpeechSynthesisUtterance* utteran
void SpeechSynthesis::speak(SpeechSynthesisUtterance* utterance)
{
if (!utterance)
return;
m_utteranceQueue.append(utterance);
// If the queue was empty, speak this immediately and add it to the queue.
......
......@@ -64,6 +64,9 @@ SpeechSynthesisVoice* SpeechSynthesisUtterance::voice() const
void SpeechSynthesisUtterance::setVoice(SpeechSynthesisVoice* voice)
{
if (!voice)
return;
// Cache our own version of the SpeechSynthesisVoice so that we don't have to do some lookup
// to go from the platform voice back to the speech synthesis voice in the read property.
m_voice = voice;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment