Commit 65dd37c3 authored by Christophe Massiot's avatar Christophe Massiot

* dvb/si.h: Improve validation of SDT.

parent 0b8f8669
......@@ -997,7 +997,7 @@ static inline bool nit_table_validate(uint8_t **pp_sections)
while ((p_ts = nit_get_ts(p_section, j)) != NULL) {
j++;
/* check that the program number if not already in the table */
/* check that the TS is not already in the table */
if (nit_table_find_ts(pp_sections, nitn_get_tsid(p_ts),
nitn_get_onid(p_ts)) != p_ts)
return false;
......@@ -1185,11 +1185,19 @@ static inline bool sdt_table_validate(uint8_t **pp_sections)
for (i = 0; i <= i_last_section; i++) {
uint8_t *p_section = psi_table_get_section(pp_sections, i);
uint8_t *p_ts;
uint8_t *p_service;
int j = 0;
if (!psi_check_crc(p_section))
return false;
while ((p_service = sdt_get_service(p_section, j)) != NULL) {
j++;
/* check that the service is not already in the table */
if (sdt_table_find_service(pp_sections, sdtn_get_sid(p_service))
!= p_service)
return false;
}
}
return true;
......
......@@ -823,7 +823,7 @@ static inline bool pat_table_validate(uint8_t **pp_sections)
while ((p_program = pat_get_program(p_section, j)) != NULL) {
j++;
/* check that the program number if not already in the table */
/* check that the program number is not already in the table */
if (pat_table_find_program(pp_sections,
patn_get_program(p_program)) != p_program)
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment