summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-09 15:05:56 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-09 15:05:56 +0000
commit8760b0cb71dc6aa9c08d926712e64218931a1782 (patch)
tree01ff01429199a808f558b599b2348bf2adf6ee2b /libass
parent1ff8a607e962c89d9afd2f7b682f7d35f25835ad (diff)
downloadmpv-8760b0cb71dc6aa9c08d926712e64218931a1782.tar.bz2
mpv-8760b0cb71dc6aa9c08d926712e64218931a1782.tar.xz
Fix \fn without an argument consuming the next '\'.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27242 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 1d70ea4ef3..d6e94a7544 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -679,11 +679,11 @@ static void reset_render_context(void);
* \param pwr multiplier for some tag effects (comes from \t tags)
*/
static char* parse_tag(char* p, double pwr) {
-#define skip_all(x) if (*p == (x)) ++p; else { \
- while ((*p != (x)) && (*p != '}') && (*p != 0)) {++p;} }
+#define skip_to(x) while ((*p != (x)) && (*p != '}') && (*p != 0)) { ++p;}
#define skip(x) if (*p == (x)) ++p; else { return p; }
- skip_all('\\');
+ skip_to('\\');
+ skip('\\');
if ((*p == '}') || (*p == 0))
return p;
@@ -787,7 +787,7 @@ static char* parse_tag(char* p, double pwr) {
} else if (mystrcmp(&p, "fn")) {
char* start = p;
char* family;
- skip_all('\\');
+ skip_to('\\');
if (p > start) {
family = malloc(p - start + 1);
strncpy(family, start, p - start);
@@ -928,7 +928,8 @@ static char* parse_tag(char* p, double pwr) {
}
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
+ skip_to(')'); // in case there is some unknown tag or a comment
+ skip(')');
} else if (mystrcmp(&p, "clip")) {
int x0, y0, x1, y1;
int res = 1;
@@ -1031,7 +1032,7 @@ static char* parse_tag(char* p, double pwr) {
return p;
#undef skip
-#undef skip_all
+#undef skip_to
}
/**