Commit 44df2d61 authored by Christophe Massiot's avatar Christophe Massiot

* examples/dvb_print_si.c: Check EIT's consistency.

parent d2f0a96a
...@@ -390,6 +390,20 @@ static void handle_sdt_section(uint16_t i_pid, uint8_t *p_section) ...@@ -390,6 +390,20 @@ static void handle_sdt_section(uint16_t i_pid, uint8_t *p_section)
handle_sdt(); handle_sdt();
} }
/*****************************************************************************
* handle_eit
*****************************************************************************/
static void handle_eit_section(uint16_t i_pid, uint8_t *p_eit)
{
if (i_pid != EIT_PID || !eit_validate(p_eit)) {
printf("invalid EIT section received on PID %hu\n", i_pid);
free(p_eit);
return;
}
free(p_eit);
}
/***************************************************************************** /*****************************************************************************
* handle_section * handle_section
*****************************************************************************/ *****************************************************************************/
...@@ -421,6 +435,13 @@ static void handle_section(uint16_t i_pid, uint8_t *p_section) ...@@ -421,6 +435,13 @@ static void handle_section(uint16_t i_pid, uint8_t *p_section)
break; break;
default: default:
if (i_table_id == EIT_TABLE_ID_PF_ACTUAL ||
(i_table_id >= EIT_TABLE_ID_SCHED_ACTUAL_FIRST &&
i_table_id <= EIT_TABLE_ID_SCHED_ACTUAL_LAST)) {
handle_eit_section(i_pid, p_section);
break;
}
free( p_section ); free( p_section );
break; break;
} }
...@@ -483,6 +504,7 @@ int main(int i_argc, char **ppsz_argv) ...@@ -483,6 +504,7 @@ int main(int i_argc, char **ppsz_argv)
p_pids[PAT_PID].i_psi_refcount++; p_pids[PAT_PID].i_psi_refcount++;
p_pids[NIT_PID].i_psi_refcount++; p_pids[NIT_PID].i_psi_refcount++;
p_pids[SDT_PID].i_psi_refcount++; p_pids[SDT_PID].i_psi_refcount++;
p_pids[EIT_PID].i_psi_refcount++;
while (!feof(stdin) && !ferror(stdin)) { while (!feof(stdin) && !ferror(stdin)) {
uint8_t p_ts[TS_SIZE]; uint8_t p_ts[TS_SIZE];
......
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