mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 16:51:10 +00:00
parent
43dd0ec62a
commit
7626b494cb
1 changed files with 23 additions and 28 deletions
|
@ -563,21 +563,23 @@ _gst_mpegts_dvb_linkage_descriptor_copy (GstMpegtsDVBLinkageDescriptor * source)
|
|||
void
|
||||
gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source)
|
||||
{
|
||||
switch (source->linkage_type) {
|
||||
case GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER:
|
||||
g_slice_free (GstMpegtsDVBLinkageMobileHandOver, source->linkage_data);
|
||||
break;
|
||||
case GST_MPEGTS_DVB_LINKAGE_EVENT:
|
||||
g_slice_free (GstMpegtsDVBLinkageEvent, source->linkage_data);
|
||||
break;
|
||||
case GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT:
|
||||
g_ptr_array_unref (source->linkage_data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (source->linkage_data)
|
||||
switch (source->linkage_type) {
|
||||
case GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER:
|
||||
g_slice_free (GstMpegtsDVBLinkageMobileHandOver, source->linkage_data);
|
||||
break;
|
||||
case GST_MPEGTS_DVB_LINKAGE_EVENT:
|
||||
g_slice_free (GstMpegtsDVBLinkageEvent, source->linkage_data);
|
||||
break;
|
||||
case GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT:
|
||||
g_ptr_array_unref (source->linkage_data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
g_slice_free1 (source->private_data_length, source->private_data_bytes);
|
||||
if (source->private_data_bytes)
|
||||
g_slice_free1 (source->private_data_length, source->private_data_bytes);
|
||||
g_slice_free (GstMpegtsDVBLinkageDescriptor, source);
|
||||
}
|
||||
|
||||
|
@ -635,7 +637,7 @@ gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
|
|||
GstMpegtsDVBLinkageMobileHandOver *hand_over;
|
||||
|
||||
if (end - data < 1)
|
||||
return FALSE;
|
||||
goto fail;
|
||||
|
||||
hand_over = g_slice_new0 (GstMpegtsDVBLinkageMobileHandOver);
|
||||
res->linkage_data = (gpointer) hand_over;
|
||||
|
@ -650,22 +652,16 @@ gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
|
|||
GST_MPEGTS_DVB_LINKAGE_HAND_OVER_LOCAL_VARIATION
|
||||
|| hand_over->hand_over_type ==
|
||||
GST_MPEGTS_DVB_LINKAGE_HAND_OVER_ASSOCIATED) {
|
||||
if (end - data < 2) {
|
||||
g_slice_free (GstMpegtsDVBLinkageMobileHandOver, hand_over);
|
||||
res->linkage_data = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
if (end - data < 2)
|
||||
goto fail;
|
||||
|
||||
hand_over->network_id = GST_READ_UINT16_BE (data);
|
||||
data += 2;
|
||||
}
|
||||
|
||||
if (hand_over->origin_type == 0) {
|
||||
if (end - data < 2) {
|
||||
g_slice_free (GstMpegtsDVBLinkageMobileHandOver, hand_over);
|
||||
res->linkage_data = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
if (end - data < 2)
|
||||
goto fail;
|
||||
|
||||
hand_over->initial_service_id = GST_READ_UINT16_BE (data);
|
||||
data += 2;
|
||||
|
@ -676,7 +672,7 @@ gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
|
|||
GstMpegtsDVBLinkageEvent *event;
|
||||
|
||||
if (end - data < 3)
|
||||
return FALSE;
|
||||
goto fail;
|
||||
|
||||
event = g_slice_new0 (GstMpegtsDVBLinkageEvent);
|
||||
res->linkage_data = (gpointer) event;
|
||||
|
@ -765,8 +761,7 @@ gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
|
|||
return TRUE;
|
||||
|
||||
fail:
|
||||
g_ptr_array_unref (res->linkage_data);
|
||||
res->linkage_data = NULL;
|
||||
gst_mpegts_dvb_linkage_descriptor_free (res);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue