[MPlayer-cvslog] r23151 - trunk/libass/ass_render.c

eugeni subversion at mplayerhq.hu
Fri Apr 27 16:18:44 CEST 2007


Author: eugeni
Date: Fri Apr 27 16:18:44 2007
New Revision: 23151

Log:
Fix division by zero in "\t" parsing.


Modified:
   trunk/libass/ass_render.c

Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	(original)
+++ trunk/libass/ass_render.c	Fri Apr 27 16:18:44 2007
@@ -929,11 +929,14 @@ static char* parse_tag(char* p, double p
 		if (v3 < 0.)
 			v3 = 0.;
 		t = frame_context.time - render_context.event->Start; // FIXME: move to render_context
-		if (t < t1)
+		if (t <= t1)
 			k = 0.;
-		else if (t > t2)
+		else if (t >= t2)
 			k = 1.;
-		else k = pow(((double)(t - t1)) / delta_t, v3);
+		else {
+			assert(delta_t != 0.);
+			k = pow(((double)(t - t1)) / delta_t, v3);
+		}
 		while (*p == '\\')
 			p = parse_tag(p, k); // maybe k*pwr ? no, specs forbid nested \t's 
 		skip_all(')'); // FIXME: better skip(')'), but much more tags support required



More information about the MPlayer-cvslog mailing list