summaryrefslogtreecommitdiff
path: root/gst/mpegtsmux
diff options
context:
space:
mode:
authorKrzysztof Konopko <krzysztof.konopko@youview.com>2012-11-26 19:21:03 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-11-27 19:00:25 +0000
commit13910f515462282e61b499c288418534d5672316 (patch)
treee9682cc495fda7008d15476634b31c23aba6f0f3 /gst/mpegtsmux
parent4d32d1f27b5884aebdc8f37bb6413444b9b06ea2 (diff)
downloadgstreamer-plugins-bad-13910f515462282e61b499c288418534d5672316.tar.gz
mpegtsmux: crashes when trying to re-use the element
A crash occured after pushing buffers and changing mpegtsmux state to NULL/READ and then back to PLAYING/PAUSED. The crash was caused by holding a dangling pointer in the MpegTsMux program table. Additionally stream headers were leaked when resetting the element: mux->streamheader set to NULL in mpegtsmux_reset() before it's released later in the same function. Added a unit test: test_multiple_state_change https://bugzilla.gnome.org/show_bug.cgi?id=689107
Diffstat (limited to 'gst/mpegtsmux')
-rw-r--r--gst/mpegtsmux/mpegtsmux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 26f18b11e..78e7cbd56 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -354,7 +354,6 @@ mpegtsmux_reset (MpegTsMux * mux, gboolean alloc)
mux->last_ts = 0;
mux->is_delta = TRUE;
- mux->streamheader = NULL;
mux->streamheader_sent = FALSE;
mux->force_key_unit_event = NULL;
mux->pending_key_unit_ts = GST_CLOCK_TIME_NONE;
@@ -374,6 +373,8 @@ mpegtsmux_reset (MpegTsMux * mux, gboolean alloc)
mux->tsmux = NULL;
}
+ memset (mux->programs, 0, sizeof (mux->programs));
+
if (mux->streamheader) {
GstBuffer *buf;
GList *sh;