History

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.

Kacper Michajłow committed 2 years ago

Commit 893ea5e1 parent 82ffe8f2 files · +4 −2Browse files

Unified · Split

2 files
  1. filters/f_decoder_wrapper.c +1 −2
  2. filters/filter.c +3 −0
filters/f_decoder_wrapper.c+1−2
@@ -1114,8 +1114,7 @@ static void public_f_reset(struct mp_filter *f) · 1113 unmodified lines
11141114 if (p->queue) {
11151115 mp_async_queue_reset(p->queue);
11161116 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);
11191118 mp_dispatch_interrupt(p->dec_dispatch);
11201119 thread_unlock(p);
11211120 mp_async_queue_resume(p->queue);
filters/filter.c+3−0
@@ -592,6 +592,9 @@ static void reset_pin(struct mp_pin *p) · 591 unmodified lines
592592
593593 void mp_filter_reset(struct mp_filter *filter)
594594 {
595+ if (!filter)
596+ return;
597+
595598 for (int n = 0; n < filter->in->num_children; n++)
596599 mp_filter_reset(filter->in->children[n]);
597600

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t