Hello community,

here is the log from the commit of package festival for openSUSE:Factory 
checked in at 2020-06-22 17:45:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/festival (Old)
 and      /work/SRC/openSUSE:Factory/.festival.new.2956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "festival"

Mon Jun 22 17:45:55 2020 rev:37 rq:816238 version:2.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/festival/festival.changes        2020-06-07 
21:38:21.945459120 +0200
+++ /work/SRC/openSUSE:Factory/.festival.new.2956/festival.changes      
2020-06-22 17:45:57.525856962 +0200
@@ -1,0 +2,8 @@
+Fri Jun 19 08:16:21 UTC 2020 - Yasuhiko Kamata <[email protected]>
+
+- Added speech_tools-null-fragile.patch and
+  festival-null-fragile.patch to fix NULL dereference problem
+  (EST_Item's method may be called even though "this" is NULL);
+  it causes SIGSEGV in text2wave (boo#1173193).
+
+-------------------------------------------------------------------

New:
----
  festival-null-fragile.patch
  speech_tools-null-fragile.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ festival.spec ++++++
--- /var/tmp/diff_new_pack.4dRj64/_old  2020-06-22 17:45:58.337859509 +0200
+++ /var/tmp/diff_new_pack.4dRj64/_new  2020-06-22 17:45:58.337859509 +0200
@@ -54,6 +54,8 @@
 # PATCH-FIX-UPSTREAM speech_tools-no-LD_LIBRARY_PATH-extension.patch 
[email protected] -- Do not change LD_LIBRARY_PATH in binaries, to avoid any 
risks
 Patch17:        speech_tools-no-LD_LIBRARY_PATH-extension.patch
 Patch18:        speech_tools-remove-errneous-decl.patch
+Patch19:        speech_tools-null-fragile.patch
+Patch20:        festival-null-fragile.patch
 BuildRequires:  gcc-c++
 BuildRequires:  ncurses-devel
 BuildRequires:  pkgconfig
@@ -91,6 +93,9 @@
 %patch12
 %patch17 -p1
 %patch18 -p1
+%patch19 -p1
+cd ../festival
+%patch20 -p1
 
 %build
 %global _lto_cflags %{_lto_cflags} -ffat-lto-objects

++++++ festival-null-fragile.patch ++++++
diff -Naru festival_orig/src/arch/festival/wave.cc 
festival/src/arch/festival/wave.cc
--- festival_orig/src/arch/festival/wave.cc     2017-09-05 00:54:08.000000000 
+0900
+++ festival/src/arch/festival/wave.cc  2020-06-19 16:25:48.142264235 +0900
@@ -421,7 +421,8 @@
     EST_Item *s;
     EST_Track f0;
     float p = 0.0;
-    float length = u->relation("Segment")->rlast()->f("end");
+    EST_Val undef;
+    float length = ((u->relation("Segment")->rlast() != NULL) ? 
u->relation("Segment")->rlast()->f("end") : undef);
     int i,frames = (int)(length / 0.010);
     f0.resize(frames,4);
     
diff -Naru festival_orig/src/modules/Intonation/duffint.cc 
festival/src/modules/Intonation/duffint.cc
--- festival_orig/src/modules/Intonation/duffint.cc     2017-09-05 
00:54:08.000000000 +0900
+++ festival/src/modules/Intonation/duffint.cc  2020-06-19 16:41:26.710269735 
+0900
@@ -83,6 +83,7 @@
     LISP params;
     float start,end;
     int n_frames;
+    EST_Val undef;
     
     *cdebug << "Intonation duff module\n";
 
@@ -91,7 +92,7 @@
     start = get_param_float("start",params,130.0);
     end = get_param_float("end",params,110.0);
 
-    pm = track(u->relation(get_c_string(relname))->head()->f("coefs"));
+    pm = track((u->relation(get_c_string(relname))->head() != NULL) ? 
u->relation(get_c_string(relname))->head()->f("coefs") : undef);
 
     float pp = 1.0/start;
     //    float end_time = ((float)pm->num_frames()) * pp;
diff -Naru festival_orig/src/modules/Intonation/int_aux.cc 
festival/src/modules/Intonation/int_aux.cc
--- festival_orig/src/modules/Intonation/int_aux.cc     2017-09-05 
00:54:08.000000000 +0900
+++ festival/src/modules/Intonation/int_aux.cc  2020-06-19 17:04:28.152883387 
+0900
@@ -95,7 +95,7 @@
     EST_Item *s;
     int i;
 
-    f0.resize(int(ceil(last_leaf(targ.first())->F("pos",0) / shift)), 1);
+    f0.resize(int(ceil( ((targ.first() != NULL) ? 
last_leaf(targ.first())->F("pos",0) : 0) / shift)), 1);
     f0.fill_time(shift);
 
     s = first_leaf(targ.first());
@@ -108,8 +108,8 @@
        f0.a(i) = 0.0;
     }
 
-    prev_pos = s->F("pos",0);
-    prev_f0 = s->F("f0",0);
+    prev_pos = ((s != NULL) ? s->F("pos",0) : 0);
+    prev_f0 = ((s != NULL) ? s->F("f0",0) : 0);
 
     s = next_leaf(s);
 
diff -Naru festival_orig/src/modules/UniSyn/UniSyn.cc 
festival/src/modules/UniSyn/UniSyn.cc
--- festival_orig/src/modules/UniSyn/UniSyn.cc  2017-09-05 00:54:08.000000000 
+0900
+++ festival/src/modules/UniSyn/UniSyn.cc       2020-06-19 16:44:48.575201760 
+0900
@@ -161,11 +161,13 @@
     if (seg.load(seg_file) != format_ok)
        return NIL;
 
-    if (!ph_is_silence(seg.tail()->f("name")))
-    {
+    if (seg.tail() != NULL) {
+      if (!ph_is_silence(seg.tail()->f("name")))
+      {
        EST_Item *n = seg.tail()->insert_after();
        n->set("name", ph_silence());
        n->set("end", iprev(seg.tail())->F("end") + 0.1);
+      }
     }
 
     us_get_copy_wave(*utt, *sig, *pm, seg);
@@ -182,13 +184,14 @@
     EST_Relation *f0_rel=0, *pm_rel=0;
     EST_Track *f0=0, *pm=0;
     EST_Item *a;
+    EST_Val undef;
 
     float end_time = (l_end_time == NIL) ? -1 : get_c_float(l_end_time);
 
     f0_rel = utt->relation(get_c_string(l_f0_name), 1);
     pm_rel = utt->create_relation(get_c_string(l_pm_name));
 
-    f0 = track(f0_rel->head()->f("f0"));
+    f0 = track((f0_rel->head() != NULL) ? f0_rel->head()->f("f0") : undef);
     pm = new EST_Track;
 
     a = pm_rel->append();
@@ -198,7 +201,7 @@
     if (utt->relation_present("SourceCoef"))
     {
        EST_Track *source_coef = 
-           track(utt->relation("SourceCoef")->head()->f("coefs"));
+           track((utt->relation("SourceCoef")->head() != NULL) ? 
utt->relation("SourceCoef")->head()->f("coefs") : undef);
        num_channels = source_coef->num_channels();
     }
 
@@ -214,11 +217,12 @@
     EST_Track *source_pm = 0;
     EST_Track *target_pm = 0;
     EST_IVector *map = 0;
+    EST_Val undef;
     target_pm = 
-       track(utt->relation(get_c_string(ltarget_name))->head()->f("coefs"));
+       track((utt->relation(get_c_string(ltarget_name))->head() != NULL) ? 
utt->relation(get_c_string(ltarget_name))->head()->f("coefs") : undef);
     source_pm = 
-       track(utt->relation(get_c_string(lsource_name))->head()->f("coefs"));
-    map = ivector(utt->relation("US_map")->head()->f("map"));
+       track((utt->relation(get_c_string(lsource_name))->head() != NULL) ? 
utt->relation(get_c_string(lsource_name))->head()->f("coefs") : undef);
+    map = ivector((utt->relation("US_map")->head() != NULL) ? 
utt->relation("US_map")->head()->f("map") : undef);
 
     utt->create_relation(get_c_string(lrel_name));
 
diff -Naru festival_orig/src/modules/UniSyn/ps_synthesis.cc 
festival/src/modules/UniSyn/ps_synthesis.cc
--- festival_orig/src/modules/UniSyn/ps_synthesis.cc    2017-09-05 
00:54:08.000000000 +0900
+++ festival/src/modules/UniSyn/ps_synthesis.cc 2020-06-19 16:54:37.105919050 
+0900
@@ -55,18 +55,19 @@
     EST_Track *source_coef, *target_coef;
     EST_Wave *sig, *res;
     EST_FVector gain;
+    EST_Val undef;
 
-    frames = wavevector(utt.relation("SourceCoef", 1)->head()->f("frame"));
+    frames = wavevector((utt.relation("SourceCoef", 1)->head() != NULL) ? 
utt.relation("SourceCoef", 1)->head()->f("frame") : undef);
 
-    source_coef = track(utt.relation("SourceCoef", 1)->head()->f("coefs"));
-    target_coef = track(utt.relation("TargetCoef", 1)->head()->f("coefs"));
+    source_coef = track((utt.relation("SourceCoef", 1)->head() != NULL) ? 
utt.relation("SourceCoef", 1)->head()->f("coefs") : undef);
+    target_coef = track((utt.relation("TargetCoef", 1)->head() != NULL) ? 
utt.relation("TargetCoef", 1)->head()->f("coefs") : undef);
 
-    map = ivector(utt.relation("US_map", 1)->head()->f("map"));
+    map = ivector((utt.relation("US_map", 1)->head() != NULL) ? 
utt.relation("US_map", 1)->head()->f("map") : undef);
 
     sig = new EST_Wave;
   
     if ( ola_method == "asymmetric_window" ){
-      frame_pm_indices = ivector(utt.relation("SourceCoef", 
1)->head()->f("pm_indices"));
+      frame_pm_indices = ivector((utt.relation("SourceCoef", 1)->head() != 
NULL) ? utt.relation("SourceCoef", 1)->head()->f("pm_indices") : undef);
       asymmetric_window_td_synthesis( *frames, *target_coef, *sig, *map, 
*frame_pm_indices );
     }
     else if ( ola_method == "synth_period" )
@@ -80,7 +81,8 @@
         // Save residual for external prcessing 
         res = new EST_Wave;
         res->copy(*sig);
-        utt.relation("TargetCoef", 
1)->head()->set_val("residual",est_val(res));
+       if (utt.relation("TargetCoef", 1)->head() != NULL)
+          utt.relation("TargetCoef", 
1)->head()->set_val("residual",est_val(res));
        // fast version
        lpc_filter_fast(*target_coef, *sig, *sig);
        // slower version (but cleaner)
diff -Naru festival_orig/src/modules/UniSyn/us_mapping.cc 
festival/src/modules/UniSyn/us_mapping.cc
--- festival_orig/src/modules/UniSyn/us_mapping.cc      2017-09-05 
00:54:08.000000000 +0900
+++ festival/src/modules/UniSyn/us_mapping.cc   2020-06-19 16:57:05.190611832 
+0900
@@ -114,12 +114,12 @@
     s_i_start = t_i_start = 0;
 
     if (target_pm.t(target_pm.num_frames() - 1) < 
-        source_lab.tail()->F("end",0))
+        ((source_lab.tail() != NULL) ? source_lab.tail()->F("end",0) : 0))
     {
         EST_warning("Target pitchmarks end before end of target segment "
                     "timings (%f vs %f). Expect a truncated utterance\n",
                     target_pm.t(target_pm.num_frames() - 1),
-                    source_lab.tail()->F("end",0.0));
+                    ((source_lab.tail() != NULL) ? 
source_lab.tail()->F("end",0.0) : 0.0));
     }
   
   
@@ -246,7 +246,7 @@
 {
   // would be good if this parameter was available from the current
   // voice...
-  float wav_srate = wave(units.head()->f("sig"))->sample_rate();
+  float wav_srate = (units.head() != NULL) ? 
wave(units.head()->f("sig"))->sample_rate() : 0;
 
   // currently, the pitchmarks are just moved, there's no deletion or
   // insertion
@@ -261,8 +261,8 @@
   // handle special case of first half of first diphone unit
   EST_Item *diphone_left = units.head();
 
-  int left_start_index = diphone_left->I("middle_frame");
-  int left_end_index = source_pm.index(diphone_left->F("end"));
+  int left_start_index = ((diphone_left != NULL) ? 
diphone_left->I("middle_frame") : 0);
+  int left_end_index = ((diphone_left != NULL ) ? 
source_pm.index(diphone_left->F("end")) : 0);
 
   for( int i=0; i<left_start_index; ++i ){
     target_pm.t(i) = source_pm.t(i);
@@ -438,7 +438,7 @@
 {
   // would be good if this parameter was available from the current
   // voice...
-  float wav_srate = wave(units.head()->f("sig"))->sample_rate();
+  float wav_srate = (units.head() != NULL) ? 
wave(units.head()->f("sig"))->sample_rate() : 0;
 
   // currently, the pitchmarks are just moved, there's no deletion or
   // insertion
@@ -453,8 +453,8 @@
   // handle special case of first half of first diphone unit
   EST_Item *diphone_left = units.head();
 
-  int left_start_index = diphone_left->I("middle_frame");
-  int left_end_index = source_pm.index(diphone_left->F("end"));
+  int left_start_index = ((diphone_left != NULL) ? 
diphone_left->I("middle_frame") : 0);
+  int left_end_index = ((diphone_left != NULL) ? 
source_pm.index(diphone_left->F("end")) : 0);
 
   for( int i=0; i<left_start_index; ++i ){
     target_pm.t(i) = source_pm.t(i);
@@ -611,9 +611,10 @@
     EST_Relation *source_lab, *target_lab;
     EST_IVector *map;
     EST_Track *source_coef=0, *target_coef=0;
+    EST_Val undef;
 
-    source_coef = track(utt.relation("SourceCoef")->head()->f("coefs"));
-    target_coef = track(utt.relation("TargetCoef")->head()->f("coefs"));
+    source_coef = track((utt.relation("SourceCoef")->head() != NULL) ? 
utt.relation("SourceCoef")->head()->f("coefs") : undef);
+    target_coef = track((utt.relation("TargetCoef")->head() != NULL) ? 
utt.relation("TargetCoef")->head()->f("coefs") : undef);
 
     map = new EST_IVector;
     
diff -Naru festival_orig/src/modules/UniSyn/us_unit.cc 
festival/src/modules/UniSyn/us_unit.cc
--- festival_orig/src/modules/UniSyn/us_unit.cc 2017-09-05 00:54:08.000000000 
+0900
+++ festival/src/modules/UniSyn/us_unit.cc      2020-06-19 16:49:35.840528086 
+0900
@@ -565,8 +565,9 @@
 
 void us_linear_smooth_amplitude( EST_Utterance *utt )
 {
-  EST_WaveVector *pp = 
wavevector(utt->relation("SourceCoef")->first()->f("frame"));
-  EST_Track *pm = track(utt->relation("SourceCoef")->first()->f("coefs"));
+  EST_Val undef;
+  EST_WaveVector *pp = wavevector((utt->relation("SourceCoef")->first() != 
NULL) ? utt->relation("SourceCoef")->first()->f("frame") : undef);
+  EST_Track *pm = track((utt->relation("SourceCoef")->first() != NULL) ? 
utt->relation("SourceCoef")->first()->f("coefs") : undef);
 
   EST_Track *energy = us_pitch_period_energy_contour( *pp, *pm );
   energy->save( "./energy_track.est", "est" );
diff -Naru festival_orig/src/modules/UniSyn_diphone/us_diphone_unit.cc 
festival/src/modules/UniSyn_diphone/us_diphone_unit.cc
--- festival_orig/src/modules/UniSyn_diphone/us_diphone_unit.cc 2017-09-05 
00:54:08.000000000 +0900
+++ festival/src/modules/UniSyn_diphone/us_diphone_unit.cc      2020-06-19 
16:15:22.975110424 +0900
@@ -63,25 +63,30 @@
     const float pause_duration = 0.1;
 
     t = segment.head();
-    if (!ph_is_silence(t->f("name")))
-    {
+    if (t != NULL) {
+      if (!ph_is_silence(t->f("name")))
+      {
        n = t->insert_before();
        n->set("name", ph_silence());
        n->set("dur", pause_duration);
        shift += pause_duration;
+      }
     }
 
     t = segment.tail();
-    if (!ph_is_silence(t->S("name")))
-    {
+    if (t != NULL) {
+      if (!ph_is_silence(t->S("name")))
+      {
        n = t->insert_after();
        n->set("name", ph_silence());
        n->set("dur", pause_duration);
        shift += pause_duration;
+      }
     }
     dur_to_end(segment);
 
-    target.tail()->set("pos", (target.tail()->F("pos") + shift));
+    if (target.tail() != NULL)
+      target.tail()->set("pos", (target.tail()->F("pos") + shift));
 }
 
 void add_end_silences(EST_Relation &segment)
@@ -89,18 +94,22 @@
   EST_Item *t, *n;
   
   t = segment.head();
-  if (!ph_is_silence(t->S("name")))
+  if (t != NULL) {
+    if (!ph_is_silence(t->S("name")))
     {
       n = t->insert_before();
       n->set("name", ph_silence());
     }
+  }
   
   t = segment.tail();
-  if (!ph_is_silence(t->S("name")))
+  if (t != NULL) {
+    if (!ph_is_silence(t->S("name")))
     {
       n = t->insert_after();
       n->set("name", ph_silence());
     }
+  }
 }
 
 void parse_diphone_times(EST_Relation &diphone_stream, 
diff -Naru festival_orig/src/modules/clunits/cljoin.cc 
festival/src/modules/clunits/cljoin.cc
--- festival_orig/src/modules/clunits/cljoin.cc 2017-09-05 00:54:08.000000000 
+0900
+++ festival/src/modules/clunits/cljoin.cc      2020-06-19 16:29:25.463181614 
+0900
@@ -107,12 +107,12 @@
 //    printf("source_lab relations is %s\n",(const char *)source_lab.name());
 
     if (target_pm.t(target_pm.num_frames() - 1) < 
-       source_lab.tail()->F("end",0))
+       ((source_lab.tail() != NULL) ? source_lab.tail()->F("end",0) : 0))
     {
        EST_warning("Target pitchmarks end before end of target segment "
                    "timings (%f vs %f). Expect a truncated utterance\n",
                    target_pm.t(target_pm.num_frames() - 1),
-                   source_lab.tail()->F("end",0.0));
+                   ((source_lab.tail() != NULL) ? 
source_lab.tail()->F("end",0.0) : 0.0));
     }
 
     n_i = 0;
@@ -170,9 +170,10 @@
     EST_IVector *map;
     EST_Track *source_coef=0, *target_coef=0;
     float dur_impose_factor, f0_impose_factor;
+    EST_Val undef;
 
-    source_coef = track(utt.relation("SourceCoef")->head()->f("coefs"));
-    target_coef = track(utt.relation("TargetCoef")->head()->f("coefs"));
+    source_coef = track((utt.relation("SourceCoef")->head() != NULL) ? 
utt.relation("SourceCoef")->head()->f("coefs") : undef);
+    target_coef = track((utt.relation("TargetCoef")->head() != NULL) ? 
utt.relation("TargetCoef")->head()->f("coefs") : undef);
     target_lab = utt.relation("Segment");
     
     map = new EST_IVector;
++++++ speech_tools-null-fragile.patch ++++++
diff -Naru speech_tools_orig/intonation/tilt/tilt_synthesis.cc 
speech_tools/intonation/tilt/tilt_synthesis.cc
--- speech_tools_orig/intonation/tilt/tilt_synthesis.cc 2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/intonation/tilt/tilt_synthesis.cc      2020-06-19 
14:56:04.264646395 +0900
@@ -126,7 +126,7 @@
        n = (int)(ceil((ev.tail()->F("time") + 
                        ev.tail()->F("rfc.fall_dur",0)) / f_shift)) + 1;
     else
-       n = (int)(ceil(ev.tail()->F("time")/ f_shift)) + 1;
+       n = (int)(ceil(((ev.tail() != NULL) ? ev.tail()->F("time") : 0)/ 
f_shift)) + 1;
 
     fz.resize(n, 1);
     fz.set_equal_space(true);
diff -Naru speech_tools_orig/intonation/tilt/tilt_utils.cc 
speech_tools/intonation/tilt/tilt_utils.cc
--- speech_tools_orig/intonation/tilt/tilt_utils.cc     2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/intonation/tilt/tilt_utils.cc  2020-06-19 14:55:23.216409043 
+0900
@@ -409,7 +409,7 @@
 
 int event_item(EST_Item &e)
 {      
-    return e.I("int_event", 0);
+    return ((e != NULL) ? e.I("int_event", 0) : 0);
 }
 int sil_item(EST_Item &e)
 {
diff -Naru speech_tools_orig/ling_class/EST_Relation.cc 
speech_tools/ling_class/EST_Relation.cc
--- speech_tools_orig/ling_class/EST_Relation.cc        2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/ling_class/EST_Relation.cc     2020-06-19 15:06:09.700138798 
+0900
@@ -164,6 +164,8 @@
 
 void EST_Relation::remove_item(EST_Item *node)
 {
+    if (node == NULL) return;
+
     if (p_head == node)
        p_head = inext(node);
     if (p_tail == node)
diff -Naru speech_tools_orig/ling_class/EST_relation_aux.cc 
speech_tools/ling_class/EST_relation_aux.cc
--- speech_tools_orig/ling_class/EST_relation_aux.cc    2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/ling_class/EST_relation_aux.cc 2020-06-19 16:20:43.036864073 
+0900
@@ -403,16 +403,18 @@
     float kstart;
     
     slist.clear();
-    
-    if ((keylab.tail())->F("end") < (lab.tail())->F("end"))
-    {
+   
+    if ((keylab.tail() != NULL) && (lab.tail() != NULL)) { 
+      if ((keylab.tail())->F("end") < (lab.tail())->F("end"))
+      {
        cerr << "Key file must extend beyond end of label file\n";
        return -1;
+      }
     }
 
     // find a the first keylab that will make a non-empty file
     for (k = keylab.head(); k ; k = inext(k))
-       if (k->F("end") > lab.head()->F("end"))
+       if (k->F("end") > ((lab.head() != NULL) ? lab.head()->F("end") : 0))
            break;
 
     filename = (EST_String)k->f("file");
@@ -475,15 +477,17 @@
     float kstart;
     
     mlf.clear();
-    
-    if ((keylab.tail())->F("end") < (lab.tail())->F("end"))
-    {
+   
+    if ((keylab.tail() != NULL) && (lab.tail() != NULL)) { 
+      if ((keylab.tail())->F("end") < (lab.tail())->F("end"))
+      {
        cerr << "Key file must extend beyond end of label file\n";
        return -1;
+      }
     }
     
     k = keylab.head();
-    a.f.set("name", (k->name() + ext));
+    a.f.set("name", ((k != NULL) ? (k->name() + ext) : ext));
     kstart = 0.0;
     
     for (s = lab.head(); s; s = inext(s))
@@ -544,19 +548,23 @@
        }
     }
 
+    if (target.head() != NULL) {
      if (!target.head()->f_present(time_name + "end"))
      {
         target.head()->set(time_name + "end", first_end / 2.0);
         if (do_start)
             target.head()->set(time_name + "start", 0.0);
      }
+    }
 
+    if (target.tail() != NULL) {
      if (!target.tail()->f_present(time_name + "end"))
      {
         target.tail()->set(time_name + "end", last_end + 0.01);
         if (do_start)
             target.tail()->set(time_name + "start", last_end);
      }
+    }
 
      for (s = target.head(); s; s = inext(s))
     {
@@ -624,7 +632,7 @@
     // fix option later.    
     if (al.present("-extend"))
        al.override_fval("-length", 
-                        al.fval("-extend",0) * lab.tail()->F("end"));
+                        al.fval("-extend",0) * ((lab.tail() != NULL) ? 
lab.tail()->F("end") : 0));
     
     // quantize (ie round up or down) label times
     if (al.present("-q"))
diff -Naru speech_tools_orig/ling_class/EST_relation_track.cc 
speech_tools/ling_class/EST_relation_track.cc
--- speech_tools_orig/ling_class/EST_relation_track.cc  2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/ling_class/EST_relation_track.cc       2020-06-19 
14:52:03.227252627 +0900
@@ -139,7 +139,7 @@
     int i;
     int n, endn;
 
-    n = (int)ceil(lab.tail()->F("end")/shift);
+    n = (int)ceil( ((lab.tail() != NULL) ? lab.tail()->F("end") : 0)/shift);
     endn = (req_l > 0.0) ? (int)(req_l /shift) : n;
 
     //    cout << req_l << endl;
diff -Naru speech_tools_orig/main/align_main.cc speech_tools/main/align_main.cc
--- speech_tools_orig/main/align_main.cc        2017-09-05 00:54:03.000000000 
+0900
+++ speech_tools/main/align_main.cc     2020-06-19 16:22:59.381551844 +0900
@@ -188,6 +188,7 @@
        load_sentence(u,"hypo",hts);
        r = u.relation("ref")->rlast();
        h = u.relation("hypo")->rlast();
+       if ((r != NULL) && (h != NULL)) {
        if ((!r->name().matches(id)) ||
            (r->name() != h->name()))
        {
@@ -214,6 +215,7 @@
            s_sub += sub;
            s_correct += correct;
        }
+       }
         sents++;
     }
 
@@ -311,6 +313,9 @@
 
 static int name_distance(EST_Item *r,EST_Item *h)
 {
+    if ((r == NULL) && (h == NULL)) return 0;
+    if ((r == NULL) || (h == NULL)) return 1;
+ 
     EST_String rname = r->name();
     EST_String hname = h->name();
     if ((rname == hname) ||
diff -Naru speech_tools_orig/speech_class/EST_wave_cuts.cc 
speech_tools/speech_class/EST_wave_cuts.cc
--- speech_tools_orig/speech_class/EST_wave_cuts.cc     2017-09-05 
00:54:03.000000000 +0900
+++ speech_tools/speech_class/EST_wave_cuts.cc  2020-06-19 14:54:13.180004065 
+0900
@@ -140,17 +140,19 @@
     int i, j, l, n;
     
     mtfr.clear();
-    
-    if ((key.tail())->F("end") < (fv.t(fv.num_frames() - 1)))
-    {
+   
+    if (key.tail() != NULL) {
+      if ((key.tail())->F("end") < (fv.t(fv.num_frames() - 1)))
+      {
        cerr << "Key file must extend beyond end of EST_Track\n";
        cerr << "key end: " << key.tail()->F("end") << " EST_Track end: " 
            << fv.t(fv.num_frames() - 1) << endl;
        return -1;
+      }
     }
     
     k = key.head();
-    a.set_name(k->name());
+    a.set_name((k != NULL) ? k->name() : 0);
     kstart = 0.0;
     
     length = end(*k) - kstart;

Reply via email to