Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
epggrab: eit/opentv - try to rule out another wrong memory access on …
…shutdown
  • Loading branch information
perexg committed May 28, 2015
1 parent 84c9f65 commit a964b52
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/epggrab.h
Expand Up @@ -274,6 +274,7 @@ extern uint32_t epggrab_channel_rename;
extern uint32_t epggrab_channel_renumber;
extern uint32_t epggrab_channel_reicon;
extern uint32_t epggrab_epgdb_periodicsave;
extern int epggrab_ota_running;
extern char *epggrab_ota_cron;
extern uint32_t epggrab_ota_timeout;
extern uint32_t epggrab_ota_initial;
Expand Down
13 changes: 10 additions & 3 deletions src/epggrab/module/eit.c
Expand Up @@ -579,12 +579,19 @@ _eit_callback
uint16_t onid, tsid, sid;
uint32_t extraid;
mpegts_service_t *svc;
mpegts_mux_t *mm = mt->mt_mux;
epggrab_ota_map_t *map = mt->mt_opaque;
epggrab_module_t *mod = (epggrab_module_t *)map->om_module;
mpegts_mux_t *mm;
epggrab_ota_map_t *map;
epggrab_module_t *mod;
epggrab_ota_mux_t *ota = NULL;
mpegts_psi_table_state_t *st;

if (!epggrab_ota_running)
return -1;

mm = mt->mt_mux;
map = mt->mt_opaque;
mod = (epggrab_module_t *)map->om_module;

/* Validate */
if(tableid < 0x4e || tableid > 0x6f || len < 11)
return -1;
Expand Down
29 changes: 21 additions & 8 deletions src/epggrab/module/opentv.c
Expand Up @@ -541,9 +541,15 @@ opentv_table_callback
int r = 1, cid, mjd;
int sect, last, ver;
mpegts_psi_table_state_t *st;
opentv_status_t *sta = mt->mt_opaque;
opentv_module_t *mod = sta->os_mod;
epggrab_ota_mux_t *ota = sta->os_ota;
opentv_status_t *sta;
opentv_module_t *mod;
epggrab_ota_mux_t *ota;

if (!epggrab_ota_running) return -1;

sta = mt->mt_opaque;
mod = sta->os_mod;
ota = sta->os_ota;

/* Validate */
if (len < 7) return -1;
Expand Down Expand Up @@ -612,11 +618,18 @@ static int
opentv_bat_callback
( mpegts_table_t *mt, const uint8_t *buf, int len, int tableid )
{
int *t;
opentv_status_t *sta = mt->mt_opaque;
opentv_module_t *mod = sta->os_mod;
int r = dvb_bat_callback(mt, buf, len, tableid);
epggrab_ota_mux_t *ota = sta->os_ota;
int *t, r;
opentv_status_t *sta;
opentv_module_t *mod;
epggrab_ota_mux_t *ota;

if (!epggrab_ota_running) return -1;

sta = mt->mt_opaque;
mod = sta->os_mod;
ota = sta->os_ota;

r = dvb_bat_callback(mt, buf, len, tableid);

/* Register */
if (!ota) {
Expand Down

0 comments on commit a964b52

Please sign in to comment.