changeset 23264:dc12bca7d4b5

Don't deallocate font data if it will be used later. It produced either segfault or "Error opening memory font" with any script that contains embedded fonts.
author eugeni
date Wed, 09 May 2007 21:38:28 +0000
parents f85d8e62735d
children 447eaddcf3de
files libass/ass.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass.c	Wed May 09 21:34:05 2007 +0000
+++ b/libass/ass.c	Wed May 09 21:38:28 2007 +0000
@@ -572,8 +572,10 @@
 	dsize = q - buf;
 	assert(dsize <= size / 4 * 3 + 2);
 	
-	if (track->library->extract_fonts)
+	if (track->library->extract_fonts) {
 		ass_add_font(track->library, track->parser_priv->fontname, (char*)buf, dsize);
+		buf = 0;
+	}
 
 error_decode_font:
 	if (buf) free(buf);