Fix division by zero in "\t" parsing.
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 27 Apr 2007 14:18:44 +0000 (14:18 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 27 Apr 2007 14:18:44 +0000 (14:18 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@23151 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_render.c

index e499770..f69c0c9 100644 (file)
@@ -929,11 +929,14 @@ static char* parse_tag(char* p, double pwr) {
                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