gst/mpegtsparse/mpegtsparse.c: Fix memory leak by unreffing structures when not needed.
Original commit message from CVS: patch by: Alessandro Decina * gst/mpegtsparse/mpegtsparse.c: Fix memory leak by unreffing structures when not needed. Fixes #539292.
This commit is contained in:
parent
31ce2b47c6
commit
229f3b295a
@ -1,3 +1,11 @@
|
|||||||
|
2008-07-07 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
patch by: Alessandro Decina
|
||||||
|
|
||||||
|
* gst/mpegtsparse/mpegtsparse.c:
|
||||||
|
Fix memory leak by unreffing structures when not needed.
|
||||||
|
Fixes #539292.
|
||||||
|
|
||||||
2008-07-07 Stefan Kost <ensonic@users.sf.net>
|
2008-07-07 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* gst/sdp/gstsdpdemux.c:
|
* gst/sdp/gstsdpdemux.c:
|
||||||
|
@ -1048,6 +1048,7 @@ static gboolean
|
|||||||
mpegts_parse_handle_psi (MpegTSParse * parse, MpegTSPacketizerSection * section)
|
mpegts_parse_handle_psi (MpegTSParse * parse, MpegTSPacketizerSection * section)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
GstStructure *structure = NULL;
|
||||||
|
|
||||||
if (mpegts_parse_calc_crc32 (GST_BUFFER_DATA (section->buffer),
|
if (mpegts_parse_calc_crc32 (GST_BUFFER_DATA (section->buffer),
|
||||||
GST_BUFFER_SIZE (section->buffer)) != 0) {
|
GST_BUFFER_SIZE (section->buffer)) != 0) {
|
||||||
@ -1057,59 +1058,41 @@ mpegts_parse_handle_psi (MpegTSParse * parse, MpegTSPacketizerSection * section)
|
|||||||
|
|
||||||
switch (section->table_id) {
|
switch (section->table_id) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
{
|
|
||||||
/* PAT */
|
/* PAT */
|
||||||
GstStructure *pat_info;
|
structure = mpegts_packetizer_parse_pat (parse->packetizer, section);
|
||||||
|
if (structure)
|
||||||
pat_info = mpegts_packetizer_parse_pat (parse->packetizer, section);
|
mpegts_parse_apply_pat (parse, structure);
|
||||||
if (pat_info)
|
|
||||||
mpegts_parse_apply_pat (parse, pat_info);
|
|
||||||
else
|
else
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 0x02:
|
case 0x02:
|
||||||
{
|
structure = mpegts_packetizer_parse_pmt (parse->packetizer, section);
|
||||||
/* PMT */
|
if (structure)
|
||||||
GstStructure *pmt_info;
|
mpegts_parse_apply_pmt (parse, section->pid, structure);
|
||||||
|
|
||||||
pmt_info = mpegts_packetizer_parse_pmt (parse->packetizer, section);
|
|
||||||
if (pmt_info)
|
|
||||||
mpegts_parse_apply_pmt (parse, section->pid, pmt_info);
|
|
||||||
else
|
else
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 0x40:
|
case 0x40:
|
||||||
/* NIT, actual network */
|
/* NIT, actual network */
|
||||||
case 0x41:
|
case 0x41:
|
||||||
/* NIT, other network */
|
/* NIT, other network */
|
||||||
{
|
structure = mpegts_packetizer_parse_nit (parse->packetizer, section);
|
||||||
GstStructure *nit_info;
|
if (structure)
|
||||||
|
mpegts_parse_apply_nit (parse, section->pid, structure);
|
||||||
nit_info = mpegts_packetizer_parse_nit (parse->packetizer, section);
|
|
||||||
if (nit_info)
|
|
||||||
mpegts_parse_apply_nit (parse, section->pid, nit_info);
|
|
||||||
else
|
else
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 0x42:
|
case 0x42:
|
||||||
case 0x46:
|
case 0x46:
|
||||||
{
|
structure = mpegts_packetizer_parse_sdt (parse->packetizer, section);
|
||||||
/* SDT */
|
if (structure)
|
||||||
GstStructure *sdt_info;
|
mpegts_parse_apply_sdt (parse, section->pid, structure);
|
||||||
|
|
||||||
sdt_info = mpegts_packetizer_parse_sdt (parse->packetizer, section);
|
|
||||||
if (sdt_info)
|
|
||||||
mpegts_parse_apply_sdt (parse, section->pid, sdt_info);
|
|
||||||
else
|
else
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 0x4E:
|
case 0x4E:
|
||||||
case 0x4F:
|
case 0x4F:
|
||||||
/* EIT, present/following */
|
/* EIT, present/following */
|
||||||
@ -1146,21 +1129,19 @@ mpegts_parse_handle_psi (MpegTSParse * parse, MpegTSPacketizerSection * section)
|
|||||||
case 0x6E:
|
case 0x6E:
|
||||||
case 0x6F:
|
case 0x6F:
|
||||||
/* EIT, schedule */
|
/* EIT, schedule */
|
||||||
{
|
structure = mpegts_packetizer_parse_eit (parse->packetizer, section);
|
||||||
/* EIT */
|
if (structure)
|
||||||
GstStructure *eit_info;
|
mpegts_parse_apply_eit (parse, section->pid, structure);
|
||||||
|
|
||||||
eit_info = mpegts_packetizer_parse_eit (parse->packetizer, section);
|
|
||||||
if (eit_info)
|
|
||||||
mpegts_parse_apply_eit (parse, section->pid, eit_info);
|
|
||||||
else
|
else
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (structure)
|
||||||
|
gst_structure_free (structure);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user