mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-12 09:15:29 +00:00
mpegtsmux: guard against _dispose being called mutiple times
_dispose calls _reset, so we need to make sure _reset handles already NULLed fields. Coverity 1139843
This commit is contained in:
parent
d6dc066527
commit
d47727c032
1 changed files with 10 additions and 6 deletions
|
@ -388,7 +388,9 @@ mpegtsmux_reset (MpegTsMux * mux, gboolean alloc)
|
||||||
mux->element_index = NULL;
|
mux->element_index = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (mux->adapter)
|
||||||
gst_adapter_clear (mux->adapter);
|
gst_adapter_clear (mux->adapter);
|
||||||
|
if (mux->out_adapter)
|
||||||
gst_adapter_clear (mux->out_adapter);
|
gst_adapter_clear (mux->out_adapter);
|
||||||
|
|
||||||
if (mux->tsmux) {
|
if (mux->tsmux) {
|
||||||
|
@ -414,10 +416,12 @@ mpegtsmux_reset (MpegTsMux * mux, gboolean alloc)
|
||||||
gst_event_replace (&mux->force_key_unit_event, NULL);
|
gst_event_replace (&mux->force_key_unit_event, NULL);
|
||||||
gst_buffer_replace (&mux->out_buffer, NULL);
|
gst_buffer_replace (&mux->out_buffer, NULL);
|
||||||
|
|
||||||
|
if (mux->collect) {
|
||||||
GST_COLLECT_PADS_STREAM_LOCK (mux->collect);
|
GST_COLLECT_PADS_STREAM_LOCK (mux->collect);
|
||||||
for (walk = mux->collect->data; walk != NULL; walk = g_slist_next (walk))
|
for (walk = mux->collect->data; walk != NULL; walk = g_slist_next (walk))
|
||||||
mpegtsmux_pad_reset ((MpegTsPadData *) walk->data);
|
mpegtsmux_pad_reset ((MpegTsPadData *) walk->data);
|
||||||
GST_COLLECT_PADS_STREAM_UNLOCK (mux->collect);
|
GST_COLLECT_PADS_STREAM_UNLOCK (mux->collect);
|
||||||
|
}
|
||||||
|
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
mux->tsmux = tsmux_new ();
|
mux->tsmux = tsmux_new ();
|
||||||
|
|
Loading…
Reference in a new issue