From 452d1d6c61734706703a1d59f276403da0c0774d Mon Sep 17 00:00:00 2001 From: eugeni Date: Fri, 3 Nov 2006 01:41:48 +0000 Subject: [PATCH] Bugfix: sub_recode could deallocate global sub_cp under some circumstances. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20618 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass.c b/libass/ass.c index f55675bb05..81aff429dc 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -805,7 +805,7 @@ static char* sub_recode(char* data, size_t size, char* codepage) 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