# HG changeset patch # User eugeni # Date 1171989438 0 # Node ID b0ae9876168ef1b18a0c232951c33879161308f9 # Parent 12dd6a38b5e09c9643c3ae46790fc8833d49fb95 \fn without an argument resets font family to the value from style. Fixes bugzilla #762. diff -r 12dd6a38b5e0 -r b0ae9876168e libass/ass_render.c --- 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;