diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-28 10:37:46 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-27 07:21:00 +0100 |
commit | 66e8328d049a60b1adb78f315ecd002f42954e1d (patch) | |
tree | 02755e9cbdd738517e0ad5cdfe338da95ceb8d6d /libavfilter | |
parent | 33f78e278b22c32c3e214a09b0b9da49adf5ee63 (diff) | |
download | ffmpeg-66e8328d049a60b1adb78f315ecd002f42954e1d.tar.gz |
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.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit dfd46e2d160afcb7e453d0e2394a6978cb447712)
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_headphone.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c index ea09294932..3d4aca9fa8 100644 --- a/libavfilter/af_headphone.c +++ b/libavfilter/af_headphone.c @@ -631,8 +631,14 @@ static int activate(AVFilterContext *ctx) if ((ret = check_ir(ctx->inputs[i], i)) < 0) return ret; - if (ff_outlink_get_status(ctx->inputs[i]) == AVERROR_EOF) + if (ff_outlink_get_status(ctx->inputs[i]) == AVERROR_EOF) { + if (!ff_inlink_queued_samples(ctx->inputs[i])) { + av_log(ctx, AV_LOG_ERROR, "No samples provided for " + "HRIR stream %d.\n", i - 1); + return AVERROR_INVALIDDATA; + } s->in[i].eof = 1; + } } for (i = 1; i < s->nb_inputs; i++) { |