Commit 6dc3844a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Zero tab entries when you allocate them

Fix unitialized pointer usages (possibly exploitable).
(cherry picked from commit 6d3c22f2)
parent 4f26e725
...@@ -498,25 +498,22 @@ static bool parse_track_node COMPLEX_INTERFACE ...@@ -498,25 +498,22 @@ static bool parse_track_node COMPLEX_INTERFACE
if( !strcmp( psz_name, psz_element ) ) if( !strcmp( psz_name, psz_element ) )
{ {
FREE_ATT(); FREE_ATT();
if( p_demux->p_sys->i_identifier < if( p_demux->p_sys->i_identifier >=
p_demux->p_sys->i_tracklist_entries ) p_demux->p_sys->i_tracklist_entries )
{ {
p_demux->p_sys->pp_tracklist[ input_item_t **pp;
p_demux->p_sys->i_identifier ] = p_new_input; pp = realloc( p_demux->p_sys->pp_tracklist,
} (p_demux->p_sys->i_identifier + 1) * sizeof(*pp) );
else if( !pp )
{ return false;
if( p_demux->p_sys->i_identifier > p_demux->p_sys->pp_tracklist = pp;
p_demux->p_sys->i_tracklist_entries ) while( p_demux->p_sys->i_identifier >=
{ p_demux->p_sys->i_tracklist_entries )
p_demux->p_sys->i_tracklist_entries = pp[p_demux->p_sys->i_tracklist_entries++] = NULL;
p_demux->p_sys->i_identifier;
}
INSERT_ELEM( p_demux->p_sys->pp_tracklist,
p_demux->p_sys->i_tracklist_entries,
p_demux->p_sys->i_tracklist_entries,
p_new_input );
} }
p_demux->p_sys->pp_tracklist[
p_demux->p_sys->i_identifier ] = p_new_input;
return true; return true;
} }
/* there MUST have been a start tag for that element name */ /* there MUST have been a start tag for that element name */
......
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