From 796df567248b81b8d879aba01f6c1112a2b4c839 Mon Sep 17 00:00:00 2001 From: eugeni Date: Tue, 20 Feb 2007 16:37:18 +0000 Subject: \fn without an argument resets font family to the value from style. Fixes bugzilla #762. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22287 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libass/ass_render.c') diff --git a/libass/ass_render.c b/libass/ass_render.c index d179a8a0bc..ae1045efcc 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -791,9 +791,12 @@ static char* parse_tag(char* p, double pwr) { char* start = p; char* family; skip_all('\\'); - family = malloc(p - start + 1); - strncpy(family, start, p - start); - family[p - start] = '\0'; + if (p > start) { + family = malloc(p - start + 1); + strncpy(family, start, p - start); + family[p - start] = '\0'; + } else + family = strdup(render_context.style->FontName); if (render_context.family) free(render_context.family); render_context.family = family; -- cgit v1.2.3