History

avfilter/af_headphone: Check for the existence of samples

Not providing any samples makes no sense at all. And if no samples were provided for one of the HRIR streams, one would either run into an av_assert1 in ff_inlink_consume_samples() or into a segfault in take_samples() in avfilter.c.

Andreas Rheinhardt committed 6 years ago

Commit dfd46e21 parent 709fca01 file · +7 −1Browse files

Unified · Split

libavfilter/af_headphone.c+7−1
@@ -631,8 +631,14 @@ static int activate(AVFilterContext *ctx) · 630 unmodified lines
631631 if ((ret = check_ir(ctx->inputs[i], i)) < 0)
632632 return ret;
633633
634− if (ff_outlink_get_status(ctx->inputs[i]) == AVERROR_EOF)
634+ if (ff_outlink_get_status(ctx->inputs[i]) == AVERROR_EOF) {
635+ if (!ff_inlink_queued_samples(ctx->inputs[i])) {
636+ av_log(ctx, AV_LOG_ERROR, "No samples provided for "
637+ "HRIR stream %d.\n", i - 1);
638+ return AVERROR_INVALIDDATA;
639+ }
635640 s->in[i].eof = 1;
641+ }
636642 }
637643
638644 for (i = 1; i < s->nb_inputs; i++) {

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