forked from Grouper-AOSP/platform_manifest
-
Notifications
You must be signed in to change notification settings - Fork 13
/
external_svox.patch
27 lines (25 loc) · 920 Bytes
/
external_svox.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/pico/tts/svox_ssml_parser.cpp b/pico/tts/svox_ssml_parser.cpp
index 1e86940..94cd25a 100755
--- a/pico/tts/svox_ssml_parser.cpp
+++ b/pico/tts/svox_ssml_parser.cpp
@@ -57,7 +57,12 @@ SvoxSsmlParser::SvoxSsmlParser() : m_isInBreak(0), m_appendix(NULL), m_docLangua
XML_SetUserData(mParser, (void*)this);
m_datasize = 512;
m_data = new char[m_datasize];
- m_data[0] = '\0';
+ if (!m_data)
+ {
+ ALOGE("Error: failed to allocate memory for string!\n");
+ } else {
+ memset(m_data, 0, m_datasize);
+ }
}
}
@@ -120,6 +125,8 @@ void SvoxSsmlParser::startElement(const XML_Char* element, const XML_Char** attr
{
ALOGE("Error: failed to allocate memory for string!\n");
return;
+ } else {
+ memset(m_data, 0, m_datasize);
}
}