1
mirror of https://github.com/mpv-player/mpv synced 2024-10-06 14:54:02 +02:00

double free(), found by Olivier Galibert <galibert@pobox.com>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9157 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2003-01-29 12:22:00 +00:00
parent ee79e97c5e
commit 2b8643963c

View File

@ -77,9 +77,7 @@ static int control(int cmd,int arg){
static int init(int rate,int channels,int format,int flags){
int bits;
if(!ao_outputfilename) {
ao_outputfilename = (char *) malloc(sizeof(char) * 14);
strcpy(ao_outputfilename,
(ao_pcm_waveheader ? "audiodump.wav" : "audiodump.pcm"));
ao_outputfilename = strdup(ao_pcm_waveheader ? "audiodump.wav" : "audiodump.pcm");
}
/* bits is only equal to format if (format == 8) or (format == 16);
@ -138,7 +136,6 @@ static void uninit(){
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
}
fclose(fp);
free(ao_outputfilename);
}
// stop playing and empty buffers (for seeking/pause)