ref: ed4e4fc7c94d10be9c855d7e54ea63cb0b482828
parent: 0a2fea5f9b9ef5559b23396a0763c659d96858c2
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 28 20:23:55 EST 2013
Fix length calculation for "repeat -"
--- a/src/repeat.c
+++ b/src/repeat.c
@@ -49,8 +49,11 @@
}
p->num_samples = p->remaining_samples = 0;
p->remaining_repeats = p->num_repeats;
- effp->out_signal.length = effp->in_signal.length != SOX_UNKNOWN_LEN ?
- effp->in_signal.length * (p->num_repeats + 1) : SOX_UNKNOWN_LEN;
+ if (effp->in_signal.length != SOX_UNKNOWN_LEN && p->num_repeats != UINT_MAX)
+ effp->out_signal.length = effp->in_signal.length * (p->num_repeats + 1);
+ else
+ effp->out_signal.length = SOX_UNKNOWN_LEN;
+
return SOX_SUCCESS;
}