event: Only allow setting valid seqnum on events
authorEdward Hervey <edward@centricular.com>
Tue, 5 Jun 2018 14:59:50 +0000 (16:59 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 5 Jun 2018 14:59:50 +0000 (16:59 +0200)
If we want to make sure we never end up with invalid seqnum on
events let's forbid setting them.

gst/gstevent.c

index 825feca..bf9b59f 100644 (file)
@@ -448,6 +448,7 @@ void
 gst_event_set_seqnum (GstEvent * event, guint32 seqnum)
 {
   g_return_if_fail (GST_IS_EVENT (event));
+  g_return_if_fail (seqnum != GST_SEQNUM_INVALID);
 
   GST_EVENT_SEQNUM (event) = seqnum;
 }