$OpenBSD: patch-playercode_mplayer_c,v 1.7 2014/10/18 14:56:28 bcallah Exp $

Avoid setting envelope cursors to negative values.

--- playercode/mplayer.c.orig	Thu Oct  9 20:29:53 2014
+++ playercode/mplayer.c	Thu Oct  9 20:30:34 2014
@@ -368,9 +368,9 @@ static SWORD StartEnvelope(ENVPR *t,UBYTE flg,UBYTE pt
 	}
 
 	/* Fit in the envelope, still */
-	if (t->a >= t->pts)
+	if (t->a >= t->pts && t->pts != 0)
 		t->a = t->pts - 1;
-	if (t->b >= t->pts)
+	if (t->b >= t->pts && t->pts != 0)
 		t->b = t->pts-1;
 
 	return t->env[t->a].val;
