diff options
author | wm4 <wm4@nowhere> | 2019-11-25 01:04:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-25 01:04:38 +0100 |
commit | 5af9fefff63beddb924ef573e39c57030636efc9 (patch) | |
tree | 1d302957ee2ef83f5e3f24107e0d9a04ec955025 /filters/f_output_chain.c | |
parent | d123af34b5a10f4ff6dc011bc462da68c94ef9fa (diff) | |
download | mpv-5af9fefff63beddb924ef573e39c57030636efc9.tar.bz2 mpv-5af9fefff63beddb924ef573e39c57030636efc9.tar.xz |
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.
Diffstat (limited to 'filters/f_output_chain.c')
-rw-r--r-- | filters/f_output_chain.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/filters/f_output_chain.c b/filters/f_output_chain.c index 69c05ab85f..d353428abc 100644 --- a/filters/f_output_chain.c +++ b/filters/f_output_chain.c @@ -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]) |