Ignore junk in nested \t tags
commit68c326891d48427d673fa6a8069500dcb25b6eb8
authorwm4 <wm4@nowhere>
Fri, 22 Mar 2013 09:04:57 +0000 (22 10:04 +0100)
committerwm4 <wm4@nowhere>
Sun, 31 Mar 2013 18:11:43 +0000 (31 20:11 +0200)
tree3f0031830c0ef028d1179635e1189fb21bc3074a
parentd29915d067582a8fe307b67f7ad9aba2b05bb710
Ignore junk in nested \t tags

Normally, junk between tags is ignored. But unlike vsfilter, libass
doesn't do that inside \t tags. So the following fails and will never
actually switch the color: {\t(1000,1000,(\c&HFF0000&))} (The '(' and
')' are junk, and are not covered by any ASS documentation.)

Instead expecting that the last parameter to \t (the parameter that
takes nested tags) starts with '\', turn it around and assume that the
first parameter that's not a number is the last parameter. (This
parsing is kind of awkward because we don't do any lookahead.)
Likewise, let the nested tag parsing terminate on ')' instead of
checking whether a tag is started with '\'. This allows skipping
junk in the middle of the nested tag, without terminating too early.
(Check '}' and '\0' in case the tag is not properly terminated.)
libass/ass_parse.c