From 371e5d066585015b7297d9677eb9e119f3191690 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 12 Feb 2015 09:47:01 +0100 Subject: af_rubberband: fix filter error deadlock rubberband_available() can return a negative value, which we assigned to a size_t variable, leading to the frame allocation to fail. This could spam "Error filtering frame.". (That it spams this instead of exiting should probably also be considered a bug.) At least in the realtime mode and in our case, a negative return value should not have any different meaning from a 0 return value, in particular because we call rubberband_get_samples_required() or set the "final" parameter for rubberband_process() to continue/stop processing. --- audio/filter/af_rubberband.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio/filter') diff --git a/audio/filter/af_rubberband.c b/audio/filter/af_rubberband.c index b2080ae59f..83019f7597 100644 --- a/audio/filter/af_rubberband.c +++ b/audio/filter/af_rubberband.c @@ -137,8 +137,8 @@ static int filter_out(struct af_instance *af) mp_audio_skip_samples(p->pending, in_samples); } - size_t out_samples = rubberband_available(p->rubber); - if (out_samples) { + int out_samples = rubberband_available(p->rubber); + if (out_samples > 0) { struct mp_audio *out = mp_audio_pool_get(af->out_pool, af->data, out_samples); if (!out) -- cgit v1.2.3