mpegtsmux: Avoid crash releasing pad with NULL prog

If we release a pad while the muxer is running which has never been used
for aggregation (thus it does not have an assigned program), `prog` is
NULL.

Part-of: <!1411>
parent 9e977832
...@@ -1292,13 +1292,15 @@ gst_base_ts_mux_release_pad (GstElement * element, GstPad * pad) ...@@ -1292,13 +1292,15 @@ gst_base_ts_mux_release_pad (GstElement * element, GstPad * pad)
GstBaseTsMuxPad *ts_pad = GST_BASE_TS_MUX_PAD (pad); GstBaseTsMuxPad *ts_pad = GST_BASE_TS_MUX_PAD (pad);
gint pid = ts_pad->pid; gint pid = ts_pad->pid;
if (ts_pad->prog->pcr_stream == ts_pad->stream) { if (ts_pad->prog) {
tsmux_stream_pcr_unref (ts_pad->prog->pcr_stream); if (ts_pad->prog->pcr_stream == ts_pad->stream) {
ts_pad->prog->pcr_stream = NULL; tsmux_program_set_pcr_stream (ts_pad->prog, NULL);
} }
if (tsmux_remove_stream (mux->tsmux, pid, ts_pad->prog)) { if (tsmux_remove_stream (mux->tsmux, pid, ts_pad->prog)) {
g_hash_table_remove (mux->programs, GINT_TO_POINTER (ts_pad->prog_id)); g_hash_table_remove (mux->programs, GINT_TO_POINTER (ts_pad->prog_id));
}
} }
tsmux_resend_pat (mux->tsmux); tsmux_resend_pat (mux->tsmux);
tsmux_resend_si (mux->tsmux); tsmux_resend_si (mux->tsmux);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment