mpegtsmux: Avoid crash when best pad gets flushed

The 'best' pad might receive a flush event between us picking it and us
popping the buffer. In this case, the buffer will be missing.

Similar to https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/711

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1042>
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-08-31 17:17:56 +02:00 committed by GStreamer Marge Bot
parent bb19b5aa96
commit 320bc6362b

View file

@ -2294,6 +2294,10 @@ gst_base_ts_mux_aggregate (GstAggregator * agg, gboolean timeout)
GstBuffer *buffer;
buffer = gst_aggregator_pad_pop_buffer (GST_AGGREGATOR_PAD (best));
if (!buffer) {
/* We might have gotten a flush event after we picked the pad */
goto done;
}
ret =
gst_base_ts_mux_aggregate_buffer (GST_BASE_TS_MUX (agg),