avwait: Fix crash when explicitly setting end_tc to NULL
authorVivia Nikolaidou <vivia@ahiru.eu>
Tue, 7 Nov 2017 19:03:22 +0000 (21:03 +0200)
committerVivia Nikolaidou <vivia@ahiru.eu>
Tue, 7 Nov 2017 19:03:22 +0000 (21:03 +0200)
If end_tc is NULL, it means that we don't want avwait to stop at any
timecode. When explicitly setting end_tc to NULL, there is no point in
comparing end_tc with start_tc (to see if we'll reject end_tc for being
before start_tc), so the check in question is completely disabled
instead of letting it crash.

gst/timecode/gstavwait.c

index 7bcf136..27aab85 100644 (file)
@@ -434,7 +434,7 @@ gst_avwait_set_property (GObject * object, guint prop_id,
       if (self->end_tc)
         gst_video_time_code_free (self->end_tc);
       self->end_tc = g_value_dup_boxed (value);
-      if (self->tc
+      if (self->tc && self->end_tc
           && gst_video_time_code_compare (self->tc, self->end_tc) != -1) {
         gchar *start_tc, *end_tc;