aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bitterman <bitter@vtilt.com>2013-10-23 15:01:06 (GMT)
committerJean-Paul Saman <jpsaman@videolan.org>2013-11-05 07:58:26 (GMT)
commitcab777b7895636285c506a6ddc4715d774153d41 (patch)
tree1cd6b95de1624aad59cbffe565d1bc9f7e8daa6a
parent4a7ecfbf7027b23cf0e0183b7e8e3cec36db686b (diff)
ATSC: fix corruption of PSI tables
Various bugs were fixed that made ATSC tables not work optimally if at all. (cherry picked from commit efa69cd2b4237a54e3ad8d2fdfc948072dc96f41) Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
-rw-r--r--src/tables/atsc_eit.c2
-rw-r--r--src/tables/atsc_ett.c2
-rw-r--r--src/tables/atsc_mgt.c8
-rw-r--r--src/tables/atsc_stt.c2
-rw-r--r--src/tables/atsc_vct.c2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/tables/atsc_eit.c b/src/tables/atsc_eit.c
index ee04d8e..3dea1bc 100644
--- a/src/tables/atsc_eit.c
+++ b/src/tables/atsc_eit.c
@@ -360,7 +360,7 @@ static bool dvbpsi_AddSectionEIT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_eit_decoder_t *
p_section->p_payload_start[0],
p_section->i_extension,
p_section->b_current_next);
- if (p_decoder->p_building_eit)
+ if (!p_decoder->p_building_eit)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
diff --git a/src/tables/atsc_ett.c b/src/tables/atsc_ett.c
index f013ebf..300007b 100644
--- a/src/tables/atsc_ett.c
+++ b/src/tables/atsc_ett.c
@@ -297,7 +297,7 @@ static bool dvbpsi_AddSectionETT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_ett_decoder_t *
p_section->p_payload_start[0],
i_etm_id,
p_section->b_current_next);
- if (p_decoder->p_building_ett)
+ if (!p_decoder->p_building_ett)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
diff --git a/src/tables/atsc_mgt.c b/src/tables/atsc_mgt.c
index ceda056..c410e59 100644
--- a/src/tables/atsc_mgt.c
+++ b/src/tables/atsc_mgt.c
@@ -384,7 +384,7 @@ static bool dvbpsi_AddSectionMGT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_mgt_decoder_t *
p_section->i_version,
p_section->p_payload_start[0],
p_section->b_current_next);
- if (p_decoder->p_building_mgt)
+ if (!p_decoder->p_building_mgt)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
@@ -502,13 +502,17 @@ static void dvbpsi_atsc_GatherMGTSections(dvbpsi_t * p_dvbpsi,
/* Delete the sections */
dvbpsi_DeletePSISections(p_mgt_decoder->p_sections);
p_mgt_decoder->p_sections = NULL;
+ p_section = NULL;
/* signal the new MGT */
p_mgt_decoder->pf_mgt_callback(p_mgt_decoder->p_cb_data,
p_mgt_decoder->p_building_mgt);
/* Reinitialize the structures */
dvbpsi_ReInitMGT(p_mgt_decoder, false);
}
- dvbpsi_DeletePSISections(p_section);
+ if( NULL != p_section )
+ {
+ dvbpsi_DeletePSISections(p_section);
+ }
}
/*****************************************************************************
diff --git a/src/tables/atsc_stt.c b/src/tables/atsc_stt.c
index ad7fa6c..c3f23cb 100644
--- a/src/tables/atsc_stt.c
+++ b/src/tables/atsc_stt.c
@@ -288,7 +288,7 @@ static bool dvbpsi_AddSectionSTT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_stt_decoder_t *
{
p_decoder->p_building_stt = dvbpsi_atsc_NewSTT(p_section->i_table_id, p_section->i_extension,
p_section->i_version, p_section->b_current_next);
- if (p_decoder->p_building_stt)
+ if (!p_decoder->p_building_stt)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
diff --git a/src/tables/atsc_vct.c b/src/tables/atsc_vct.c
index f6302ad..1c0e09e 100644
--- a/src/tables/atsc_vct.c
+++ b/src/tables/atsc_vct.c
@@ -423,7 +423,7 @@ static bool dvbpsi_AddSectionVCT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_vct_decoder_t *
p_section->i_table_id, p_section->i_extension,
p_section->p_payload_start[0], p_section->i_table_id == 0xC9,
p_section->i_version, p_section->b_current_next);
- if (p_vct_decoder->p_building_vct)
+ if (!p_vct_decoder->p_building_vct)
return false;
p_vct_decoder->i_last_section_number = p_section->i_last_number;

Privacy Policy