0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00

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.
This commit is contained in:
wm4 2015-02-12 09:47:01 +01:00
parent 2dc49ea866
commit 371e5d0665

View File

@ -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)