Use malloc for codecdata. Fixes segfault in free_sh_sub.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25666 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2008-01-10 19:47:18 +00:00
parent ec74c68e3d
commit 85413c62e8
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ static int init(sh_audio_t *sh)
// If we don't get the ES descriptor, try manual config
if(!sh->codecdata_len && sh->wf) {
sh->codecdata_len = sh->wf->cbSize;
sh->codecdata = (char*)(sh->wf+1);
sh->codecdata = malloc(sh->codecdata_len);
memcpy(sh->codecdata, sh->wf+1, sh->codecdata_len);
mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"FAAD: codecdata extracted from WAVEFORMATEX\n");
}
if(!sh->codecdata_len) {