]> granicus.if.org Git - libass/commitdiff
Handle conflicting \t time intervals
authorGrigori Goronzy <greg@blackbox>
Mon, 29 Jun 2009 02:17:24 +0000 (04:17 +0200)
committerGrigori Goronzy <greg@blackbox>
Mon, 29 Jun 2009 02:27:43 +0000 (04:27 +0200)
If end <= start for a time interval specification, set end to the end of
the event.  VSFilter handles it like that, too.

libass/ass_render.c

index c779f3b17e690debd2a5d8aa9bdf611079a8b167..86dfd3d57d6ce7e0151c879980f33e323ce35702 100644 (file)
@@ -1269,11 +1269,11 @@ static char *parse_tag(ass_renderer_t *render_priv, char *p, double pwr)
         }
         if (cnt == 3) {
             v1 = v[0];
-            v2 = v[1];
+            v2 = (v[1] <= v1) ? render_priv->state.event->Duration : v[1];
             v3 = v[2];
         } else if (cnt == 2) {
             v1 = v[0];
-            v2 = v[1];
+            v2 = (v[1] <= v1) ? render_priv->state.event->Duration : v[1];
             v3 = 1.;
         } else if (cnt == 1) {
             v1 = 0;