changeset 22269:b0ae9876168e

\fn without an argument resets font family to the value from style. Fixes bugzilla #762.
author eugeni
date Tue, 20 Feb 2007 16:37:18 +0000
parents 12dd6a38b5e0
children 9d2aaf9197d6
files libass/ass_render.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_render.c	Tue Feb 20 16:20:55 2007 +0000
+++ b/libass/ass_render.c	Tue Feb 20 16:37:18 2007 +0000
@@ -791,9 +791,12 @@
 		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;