Browse Source

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

master
Christophe Massiot 14 years ago
parent
commit
65dd37c33e
2 changed files with 11 additions and 3 deletions
  1. +10
    -2
      dvb/si.h
  2. +1
    -1
      mpeg/psi.h

+ 10
- 2
dvb/si.h View File

@ -997,7 +997,7 @@ static inline bool nit_table_validate(uint8_t **pp_sections)
while ((p_ts = nit_get_ts(p_section, j)) != NULL) { while ((p_ts = nit_get_ts(p_section, j)) != NULL) {
j++; 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), if (nit_table_find_ts(pp_sections, nitn_get_tsid(p_ts),
nitn_get_onid(p_ts)) != p_ts) nitn_get_onid(p_ts)) != p_ts)
return false; return false;
@ -1185,11 +1185,19 @@ static inline bool sdt_table_validate(uint8_t **pp_sections)
for (i = 0; i <= i_last_section; i++) { for (i = 0; i <= i_last_section; i++) {
uint8_t *p_section = psi_table_get_section(pp_sections, i); uint8_t *p_section = psi_table_get_section(pp_sections, i);
uint8_t *p_ts;
uint8_t *p_service;
int j = 0; int j = 0;
if (!psi_check_crc(p_section)) if (!psi_check_crc(p_section))
return false; 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; return true;

+ 1
- 1
mpeg/psi.h View File

@ -823,7 +823,7 @@ static inline bool pat_table_validate(uint8_t **pp_sections)
while ((p_program = pat_get_program(p_section, j)) != NULL) { while ((p_program = pat_get_program(p_section, j)) != NULL) {
j++; 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, if (pat_table_find_program(pp_sections,
patn_get_program(p_program)) != p_program) patn_get_program(p_program)) != p_program)
return false; return false;

Loading…
Cancel
Save