mirror of https://github.com/mpv-player/mpv
player/playloop: fix null dereference if filter_root does not exist
For example when `input-commands=drop-buffers` is added to the config. Add a check inside mp_filter_reset(). Found by OSS-Fuzz.
This commit is contained in:
parent
82ffe8f425
commit
893ea5e47b
|
@ -1114,8 +1114,7 @@ static void public_f_reset(struct mp_filter *f)
|
|||
if (p->queue) {
|
||||
mp_async_queue_reset(p->queue);
|
||||
thread_lock(p);
|
||||
if (p->dec_root_filter)
|
||||
mp_filter_reset(p->dec_root_filter);
|
||||
mp_filter_reset(p->dec_root_filter);
|
||||
mp_dispatch_interrupt(p->dec_dispatch);
|
||||
thread_unlock(p);
|
||||
mp_async_queue_resume(p->queue);
|
||||
|
|
|
@ -592,6 +592,9 @@ static void reset_pin(struct mp_pin *p)
|
|||
|
||||
void mp_filter_reset(struct mp_filter *filter)
|
||||
{
|
||||
if (!filter)
|
||||
return;
|
||||
|
||||
for (int n = 0; n < filter->in->num_children; n++)
|
||||
mp_filter_reset(filter->in->children[n]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue