Commit 490324fb authored by Felix Abecassis's avatar Felix Abecassis

filter_chain: fix potential undefined behavior

If p_chain->first is NULL, we should not take the address of first->filter.
parent 8604f740
......@@ -154,10 +154,8 @@ void filter_chain_Delete( filter_chain_t *p_chain )
void filter_chain_Reset( filter_chain_t *p_chain, const es_format_t *p_fmt_in,
const es_format_t *p_fmt_out )
{
filter_t *p_filter;
while( (p_filter = &p_chain->first->filter) != NULL )
filter_chain_DeleteFilterInternal( p_chain, p_filter );
while( p_chain->first != NULL )
filter_chain_DeleteFilterInternal( p_chain, &p_chain->first->filter );
if( p_fmt_in )
{
......
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