$OpenBSD: patch-src_gain_c,v 1.1 2014/12/29 10:44:55 sthen Exp $

[1c3d52] prevent division by 0 when input signal is entirely non-negative,
non-positive, or both

--- src/gain.c.orig	Wed Dec 24 12:32:38 2014
+++ src/gain.c	Wed Dec 24 12:32:53 2014
@@ -80,7 +80,9 @@ static int start(sox_effect_t * effp)
     if (!p->do_equalise && !p->do_balance && !p->do_balance_no_clip)
       effp->flows = 1; /* essentially a conditional SOX_EFF_MCHAN */
   }
-  p->mult = p->max = p->min = 0;
+  p->mult = 0;
+  p->max = 1;
+  p->min = -1;
   if (p->do_scan) {
     p->tmp_file = lsx_tmpfile();
     if (p->tmp_file == NULL) {
