For example when `input-commands=drop-buffers` is added to the config. Add a check inside mp_filter_reset(). Found by OSS-Fuzz.
Unified · Split
| @@ -1114,8 +1114,7 @@ static void public_f_reset(struct mp_filter *f) · 1113 unmodified lines | ||
| 1114 | 1114 | if (p->queue) { |
| 1115 | 1115 | mp_async_queue_reset(p->queue); |
| 1116 | 1116 | thread_lock(p); |
| 1117 | − if (p->dec_root_filter) | |
| 1118 | − mp_filter_reset(p->dec_root_filter); | |
| 1117 | + mp_filter_reset(p->dec_root_filter); | |
| 1119 | 1118 | mp_dispatch_interrupt(p->dec_dispatch); |
| 1120 | 1119 | thread_unlock(p); |
| 1121 | 1120 | mp_async_queue_resume(p->queue); |
| @@ -592,6 +592,9 @@ static void reset_pin(struct mp_pin *p) · 591 unmodified lines | ||
| 592 | 592 | |
| 593 | 593 | void mp_filter_reset(struct mp_filter *filter) |
| 594 | 594 | { |
| 595 | + if (!filter) | |
| 596 | + return; | |
| 597 | + | |
| 595 | 598 | for (int n = 0; n < filter->in->num_children; n++) |
| 596 | 599 | mp_filter_reset(filter->in->children[n]); |
| 597 | 600 | |