mpegtsdemux: fix section_data leak

If packet->payload_unit_start_indicator is true and pointer 0, there is no
discontinuity check. Therefore there could be a previous section not complete
that need to be cleared.

https://bugzilla.gnome.org/show_bug.cgi?id=758010
This commit is contained in:
Nicolas Huet 2015-11-12 16:35:12 +01:00 committed by Sebastian Dröge
parent 6eae0c7e18
commit d65d8657e6

View file

@ -228,8 +228,6 @@ static void
mpegts_packetizer_stream_free (MpegTSPacketizerStream * stream) mpegts_packetizer_stream_free (MpegTSPacketizerStream * stream)
{ {
mpegts_packetizer_clear_section (stream); mpegts_packetizer_clear_section (stream);
if (stream->section_data)
g_free (stream->section_data);
g_slist_foreach (stream->subtables, g_slist_foreach (stream->subtables,
(GFunc) mpegts_packetizer_stream_subtable_free, NULL); (GFunc) mpegts_packetizer_stream_subtable_free, NULL);
g_slist_free (stream->subtables); g_slist_free (stream->subtables);
@ -984,6 +982,7 @@ mpegts_packetizer_push_section (MpegTSPacketizer2 * packetizer,
GST_LOG GST_LOG
("PID 0x%04x PUSI and pointer == 0, skipping straight to section_start parsing", ("PID 0x%04x PUSI and pointer == 0, skipping straight to section_start parsing",
packet->pid); packet->pid);
mpegts_packetizer_clear_section (stream);
goto section_start; goto section_start;
} }
} }