matroska: Check the return value of gst_segment_do_seek()
authorJan Schmidt <jan@centricular.com>
Fri, 20 Mar 2020 10:32:36 +0000 (21:32 +1100)
committerSeungha Yang <seungha@centricular.com>
Thu, 2 Apr 2020 05:23:17 +0000 (05:23 +0000)
gst_segment_do_seek() can fail.

gst/matroska/matroska-demux.c

index 883ac288e93e10567096c9eb0275be14ea3923c7..3d2fbd120ef6af43caafbf097a4e0d23158ce049 100644 (file)
@@ -2816,8 +2816,11 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
       seeksegment.stop = seeksegment.duration;
   }
 
-  gst_segment_do_seek (&seeksegment, rate, format, flags,
-      cur_type, cur, stop_type, stop, &update);
+  if (!gst_segment_do_seek (&seeksegment, rate, format, flags,
+          cur_type, cur, stop_type, stop, &update)) {
+    GST_WARNING_OBJECT (demux, "gst_segment_do_seek() failed.");
+    return FALSE;
+  }
 
   /* Restore the clip timestamp offset */
   if (GST_CLOCK_TIME_IS_VALID (demux->stream_start_time)) {