changeset 20602:f672f6921ced

Bugfix: sub_recode could deallocate global sub_cp under some circumstances.
author eugeni
date Fri, 03 Nov 2006 01:41:48 +0000
parents c19cb28b9490
children b0814eba65ec
files libass/ass.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass.c	Fri Nov 03 00:30:11 2006 +0000
+++ b/libass/ass.c	Fri Nov 03 01:41:48 2006 +0000
@@ -805,7 +805,7 @@
 	assert(codepage);
 
 	{
-		char* cp_tmp = codepage;
+		char* cp_tmp = codepage ? strdup(codepage) : 0;
 #ifdef HAVE_ENCA
 		char enca_lang[3], enca_fallback[100];
 		if (sscanf(codepage, "enca:%2s:%99s", enca_lang, enca_fallback) == 2