f_output_chain: fix possible crash when changing filters

When changing filters at runtime (vf/af commands/properties), this could
crash due to a NULL pointer access. The code for comparing the old and
new option values (to detect changes) was simply buggy.
This commit is contained in:
wm4 2019-11-25 01:04:38 +01:00
parent d123af34b5
commit 5af9fefff6
1 changed files with 4 additions and 2 deletions

View File

@ -518,8 +518,10 @@ static bool compare_filter(struct m_obj_settings *a, struct m_obj_settings *b)
if (a->enabled != b->enabled)
return false;
if (!a->attribs || !a->attribs[0])
return !b->attribs || !b->attribs[0];
bool a_empty = !a->attribs || !a->attribs[0];
bool b_empty = !b->attribs || !b->attribs[0];
if (a_empty || b_empty)
return a_empty == b_empty;
for (int n = 0; a->attribs[n] || b->attribs[n]; n++) {
if (!a->attribs[n] || !b->attribs[n])