tsdemux: do not keep a dangling pointer

When removing the current program, it will get freed by the
hash table removal callback, so ensure we clear our pointer
to it.

Fixes a crash later on in gst_ts_demux_push trying to access it.

https://bugzilla.gnome.org/show_bug.cgi?id=656927
This commit is contained in:
Vincent Penquerc'h 2011-08-19 13:32:14 +01:00 committed by Sebastian Dröge
parent d1a6ca2203
commit b19a5ea1f3

View file

@ -1590,6 +1590,7 @@ find_timestamps (MpegTSBase * base, guint64 initoff, guint64 * offset)
gst_structure_free (base->pat);
base->pat = NULL;
mpegts_base_remove_program (base, demux->current_program_number);
demux->program = NULL;
/* Find end position */
if (G_UNLIKELY (!gst_pad_query_peer_duration (base->sinkpad, &format,
@ -1648,6 +1649,7 @@ beach:
base->pat = NULL;
}
mpegts_base_remove_program (base, demux->current_program_number);
demux->program = NULL;
return ret;
}