Fix some crashers trying to initialize gnome-speech when no voices are

present.

Reported by:	adamw
Obtained from:	GNOME CVS
This commit is contained in:
Joe Marcus Clarke 2005-02-14 01:23:13 +00:00
parent aeca818646
commit b3d6cc0abb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=128740
2 changed files with 14 additions and 4 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= dasher
PORTVERSION= 3.2.11
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= accessibility editors x11 gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/3.2

View File

@ -1,11 +1,21 @@
--- Src/Gtk2/speech.cc.orig Fri Nov 12 13:11:45 2004
+++ Src/Gtk2/speech.cc Fri Nov 12 13:11:59 2004
--- Src/Gtk2/speech.cc.orig Fri Jul 30 15:28:41 2004
+++ Src/Gtk2/speech.cc Sun Feb 13 20:15:46 2005
@@ -46,7 +46,7 @@
voices = GNOME_Speech_SynthesisDriver_getAllVoices (rv, &ev);
- if (voices==NULL || BONOBO_EX (&ev)) {
+ if (voices==NULL || voices->_buffer==NULL || BONOBO_EX (&ev)) {
+ if (voices==NULL || BONOBO_EX (&ev) || voices->_length==0) {
printf(_("Unable to initialize voices"));
speaker=NULL;
return;
@@ -78,7 +78,8 @@
void teardown_speech() {
bonobo_object_release_unref (speaker, NULL);
- CORBA_free (voices);
+ if (voices != NULL && voices->_length != 0)
+ CORBA_free (voices);
CORBA_exception_free (&ev);
}