From: eugeni Date: Fri, 3 Nov 2006 01:41:48 +0000 (+0000) Subject: Bugfix: sub_recode could deallocate global sub_cp under some circumstances. X-Git-Tag: 0.9.7~403 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bf8ec2568cab4b59a5773e711fa5f6b87c4564b;p=libass 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 --- diff --git a/libass/ass.c b/libass/ass.c index f55675b..81aff42 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