From 28a9c4c7f6e180f999d85c32982c5aa405d48444 Mon Sep 17 00:00:00 2001 From: brianjjones Date: Tue, 27 Aug 2013 17:16:30 -0700 Subject: [PATCH] Fixed speech recognition bug that caused crashing due to empty memory read Change-Id: I5479ad38ffaec2791b03c4322fc44a7c3b24d3bb Signed-off-by: brianjjones --- packaging/wrt-plugins-ivi.spec | 1 + src/Speech/Speech.cpp | 19 ++++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packaging/wrt-plugins-ivi.spec b/packaging/wrt-plugins-ivi.spec index 98e1850..20b6ce1 100644 --- a/packaging/wrt-plugins-ivi.spec +++ b/packaging/wrt-plugins-ivi.spec @@ -28,6 +28,7 @@ BuildRequires: boost-thread BuildRequires: boost-system BuildRequires: boost-filesystem BuildRequires: pkgconfig(json-glib-1.0) +BuildRequires: speech-recognition %description JavaScript plugins for WebRuntime diff --git a/src/Speech/Speech.cpp b/src/Speech/Speech.cpp index 33c68d5..7d5a4b3 100644 --- a/src/Speech/Speech.cpp +++ b/src/Speech/Speech.cpp @@ -76,7 +76,6 @@ static void signalCallback( GDBusConnection *connection, LoggerD("signalCallback break 3"); - GVariantIter *resultIter; gchar* result; std::string strResult; @@ -111,6 +110,12 @@ static void signalCallback( GDBusConnection *connection, void SpeechMaster::onSignalReceived(SpeechEventType eventType, std::vector speechCommands) { LoggerD("SpeechMaster::onSignalReceived called"); + LoggerD("SpeechMaster::eventType" << eventType); + + for (int i = 0; i < speechCommands.size(); i++) + { + LoggerD("speechCommand: " << speechCommands.at(i)); + } switch(eventType) { @@ -179,18 +184,6 @@ void SpeechMaster::setCBListener(JSObjectRef cbObject, JSContextRef context) "End", "/srs", NULL, G_DBUS_SIGNAL_FLAGS_NONE, signalCallback, this, NULL); - g_dbus_connection_signal_subscribe(g_bus_get_sync(G_BUS_TYPE_SESSION, NULL,NULL), "org.tizen.srs", "org.tizen.srs", - NULL, "/srs", NULL, G_DBUS_SIGNAL_FLAGS_NONE, - signalCallback, this, NULL); - - g_dbus_connection_signal_subscribe(g_bus_get_sync(G_BUS_TYPE_SESSION, NULL,NULL), "org.tizen.srs", NULL, - NULL, NULL , NULL, G_DBUS_SIGNAL_FLAGS_NONE, - signalCallback, this, NULL); - - g_dbus_connection_signal_subscribe(g_bus_get_sync(G_BUS_TYPE_SESSION, NULL,NULL), NULL, NULL, - NULL, NULL , NULL, G_DBUS_SIGNAL_FLAGS_NONE, - signalCallback, this, NULL); - } -- 2.7.4