mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 06:03:45 +01:00
cleanup: remove NULL checks before free() all over the code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b492561241
commit
fe3c4810e1
@ -295,9 +295,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (driver) free(driver);
|
||||
if (fourcc) free(fourcc);
|
||||
if (filename) free(filename);
|
||||
free(driver);
|
||||
free(fourcc);
|
||||
free(filename);
|
||||
if (hDriver) CloseDriver(hDriver, 0, 0);
|
||||
if ((coinit == S_OK) || coinit == S_FALSE) CoUninitialize();
|
||||
return ret;
|
||||
|
@ -277,8 +277,7 @@ int mp_input_ar_init(void)
|
||||
(*queue)->addElement(queue, cookies[i], 0);
|
||||
|
||||
// not used anymore
|
||||
if (cookies != NULL)
|
||||
free(cookies);
|
||||
free(cookies);
|
||||
|
||||
// Start data delivery to the queue.
|
||||
(*queue)->start(queue);
|
||||
@ -290,8 +289,7 @@ int mp_input_ar_init(void)
|
||||
return 0;
|
||||
|
||||
mp_input_ar_init_error:
|
||||
if (cookies != NULL)
|
||||
free(cookies);
|
||||
free(cookies);
|
||||
if (hidDeviceInterface != NULL) {
|
||||
if (*hidDeviceInterface != NULL) {
|
||||
(*hidDeviceInterface)->close(hidDeviceInterface);
|
||||
|
@ -659,8 +659,7 @@ void mp_input_rm_cmd_fd(struct input_ctx *ictx, int fd)
|
||||
return;
|
||||
if(cmd_fds[i].close_func)
|
||||
cmd_fds[i].close_func(cmd_fds[i].fd);
|
||||
if(cmd_fds[i].buffer)
|
||||
talloc_free(cmd_fds[i].buffer);
|
||||
talloc_free(cmd_fds[i].buffer);
|
||||
|
||||
if (i + 1 < ictx->num_cmd_fd)
|
||||
memmove(&cmd_fds[i], &cmd_fds[i+1],
|
||||
@ -1131,10 +1130,8 @@ static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code)
|
||||
ictx->num_key_down--;
|
||||
ictx->last_key_down = 0;
|
||||
ictx->ar_state = -1;
|
||||
if (ictx->ar_cmd) {
|
||||
mp_cmd_free(ictx->ar_cmd);
|
||||
ictx->ar_cmd = NULL;
|
||||
}
|
||||
mp_cmd_free(ictx->ar_cmd);
|
||||
ictx->ar_cmd = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1481,8 +1478,7 @@ static void bind_keys(struct input_ctx *ictx,
|
||||
memset(&bind_section->cmd_binds[i],0,2*sizeof(mp_cmd_bind_t));
|
||||
bind = &bind_section->cmd_binds[i];
|
||||
}
|
||||
if(bind->cmd)
|
||||
talloc_free(bind->cmd);
|
||||
talloc_free(bind->cmd);
|
||||
bind->cmd = talloc_strdup(bind_section->cmd_binds, cmd);
|
||||
memcpy(bind->input,keys,(MP_MAX_KEY_DOWN+1)*sizeof(int));
|
||||
}
|
||||
@ -1652,8 +1648,7 @@ void mp_input_set_section(struct input_ctx *ictx, char *name)
|
||||
|
||||
ictx->cmd_binds = NULL;
|
||||
ictx->cmd_binds_default = NULL;
|
||||
if (ictx->section)
|
||||
talloc_free(ictx->section);
|
||||
talloc_free(ictx->section);
|
||||
if (name)
|
||||
ictx->section = talloc_strdup(ictx, name);
|
||||
else
|
||||
|
@ -115,10 +115,8 @@ int mp_input_lirc_read(int fd,char* dest, int s) {
|
||||
|
||||
void
|
||||
mp_input_lirc_close(int fd) {
|
||||
if(cmd_buf) {
|
||||
free(cmd_buf);
|
||||
cmd_buf = NULL;
|
||||
}
|
||||
free(cmd_buf);
|
||||
cmd_buf = NULL;
|
||||
lirc_freeconfig(lirc_config);
|
||||
lirc_deinit();
|
||||
}
|
||||
|
@ -624,8 +624,7 @@ int af_resize_local_buffer(af_instance_t* af, af_data_t* data)
|
||||
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Reallocating memory in module %s, "
|
||||
"old len = %i, new len = %i\n",af->info->name,af->data->len,len);
|
||||
// If there is a buffer free it
|
||||
if(af->data->audio)
|
||||
free(af->data->audio);
|
||||
free(af->data->audio);
|
||||
// Create new buffer and check that it is OK
|
||||
af->data->audio = malloc(len);
|
||||
if(!af->data->audio){
|
||||
|
@ -78,9 +78,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -107,9 +107,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
int i;
|
||||
|
||||
// Free prevous delay queues
|
||||
for(i=0;i<af->data->nch;i++){
|
||||
if(s->q[i])
|
||||
free(s->q[i]);
|
||||
}
|
||||
for(i=0;i<af->data->nch;i++)
|
||||
free(s->q[i]);
|
||||
|
||||
af->data->rate = ((af_data_t*)arg)->rate;
|
||||
af->data->nch = ((af_data_t*)arg)->nch;
|
||||
@ -112,13 +110,11 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
int i;
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
|
||||
free(af->data);
|
||||
for(i=0;i<AF_NCH;i++)
|
||||
if(((af_delay_t*)(af->setup))->q[i])
|
||||
free(((af_delay_t*)(af->setup))->q[i]);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
// Filter data through filter
|
||||
|
@ -41,7 +41,6 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
}
|
||||
|
||||
|
@ -181,9 +181,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
int mapsize;
|
||||
|
||||
// Free previous buffers
|
||||
if (s->buf && s->buf[0])
|
||||
if (s->buf)
|
||||
free(s->buf[0]);
|
||||
|
||||
// unmap previous area
|
||||
@ -136,8 +136,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
char *str = arg;
|
||||
|
||||
if (!str){
|
||||
if(s->filename)
|
||||
free(s->filename);
|
||||
free(s->filename);
|
||||
|
||||
s->filename = get_path(SHARED_FILE);
|
||||
return AF_OK;
|
||||
@ -146,8 +145,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
while((str[i]) && (str[i] != ':'))
|
||||
i++;
|
||||
|
||||
if(s->filename)
|
||||
free(s->filename);
|
||||
free(s->filename);
|
||||
|
||||
s->filename = calloc(i + 1, 1);
|
||||
memcpy(s->filename, str, i);
|
||||
@ -177,14 +175,12 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
*/
|
||||
static void uninit( struct af_instance_s* af )
|
||||
{
|
||||
if (af->data){
|
||||
free(af->data);
|
||||
af->data = NULL;
|
||||
}
|
||||
free(af->data);
|
||||
af->data = NULL;
|
||||
|
||||
if(af->setup){
|
||||
af_export_t* s = af->setup;
|
||||
if (s->buf && s->buf[0])
|
||||
if (s->buf)
|
||||
free(s->buf[0]);
|
||||
|
||||
// Free mmaped area
|
||||
@ -194,8 +190,7 @@ static void uninit( struct af_instance_s* af )
|
||||
if(s->fd > -1)
|
||||
close(s->fd);
|
||||
|
||||
if(s->filename)
|
||||
free(s->filename);
|
||||
free(s->filename);
|
||||
|
||||
free(af->setup);
|
||||
af->setup = NULL;
|
||||
|
@ -82,9 +82,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -102,9 +102,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -349,32 +349,19 @@ static void uninit(struct af_instance_s *af)
|
||||
if(af->setup) {
|
||||
af_hrtf_t *s = af->setup;
|
||||
|
||||
if(s->lf)
|
||||
free(s->lf);
|
||||
if(s->rf)
|
||||
free(s->rf);
|
||||
if(s->lr)
|
||||
free(s->lr);
|
||||
if(s->rr)
|
||||
free(s->rr);
|
||||
if(s->cf)
|
||||
free(s->cf);
|
||||
if(s->cr)
|
||||
free(s->cr);
|
||||
if(s->ba_l)
|
||||
free(s->ba_l);
|
||||
if(s->ba_r)
|
||||
free(s->ba_r);
|
||||
if(s->ba_ir)
|
||||
free(s->ba_ir);
|
||||
if(s->fwrbuf_l)
|
||||
free(s->fwrbuf_l);
|
||||
if(s->fwrbuf_r)
|
||||
free(s->fwrbuf_r);
|
||||
if(s->fwrbuf_lr)
|
||||
free(s->fwrbuf_lr);
|
||||
if(s->fwrbuf_rr)
|
||||
free(s->fwrbuf_rr);
|
||||
free(s->lf);
|
||||
free(s->rf);
|
||||
free(s->lr);
|
||||
free(s->rr);
|
||||
free(s->cf);
|
||||
free(s->cr);
|
||||
free(s->ba_l);
|
||||
free(s->ba_r);
|
||||
free(s->ba_ir);
|
||||
free(s->fwrbuf_l);
|
||||
free(s->fwrbuf_r);
|
||||
free(s->fwrbuf_lr);
|
||||
free(s->fwrbuf_rr);
|
||||
free(af->setup);
|
||||
}
|
||||
if(af->data)
|
||||
|
@ -46,8 +46,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
free(af->data);
|
||||
}
|
||||
|
||||
// Filter data through filter
|
||||
|
@ -562,7 +562,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
|
||||
|
||||
/* set new setup->myname */
|
||||
|
||||
if(setup->myname) free(setup->myname);
|
||||
free(setup->myname);
|
||||
setup->myname = calloc(strlen(af_info_ladspa.name)+strlen(setup->file)+
|
||||
strlen(setup->label)+6, 1);
|
||||
snprintf(setup->myname, strlen(af_info_ladspa.name)+
|
||||
@ -652,8 +652,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
|
||||
static void uninit(struct af_instance_s *af) {
|
||||
int i;
|
||||
|
||||
if (af->data)
|
||||
free(af->data);
|
||||
free(af->data);
|
||||
if (af->setup) {
|
||||
af_ladspa_t *setup = (af_ladspa_t*) af->setup;
|
||||
const LADSPA_Descriptor *pdes = setup->plugin_descriptor;
|
||||
@ -671,36 +670,24 @@ static void uninit(struct af_instance_s *af) {
|
||||
free(setup->chhandles);
|
||||
}
|
||||
|
||||
if (setup->file)
|
||||
free(setup->file);
|
||||
if (setup->label)
|
||||
free(setup->label);
|
||||
if (setup->inputcontrolsmap)
|
||||
free(setup->inputcontrolsmap);
|
||||
if (setup->inputcontrols)
|
||||
free(setup->inputcontrols);
|
||||
if (setup->outputcontrolsmap)
|
||||
free(setup->outputcontrolsmap);
|
||||
if (setup->outputcontrols)
|
||||
free(setup->outputcontrols);
|
||||
if (setup->inputs)
|
||||
free(setup->inputs);
|
||||
if (setup->outputs)
|
||||
free(setup->outputs);
|
||||
free(setup->file);
|
||||
free(setup->label);
|
||||
free(setup->inputcontrolsmap);
|
||||
free(setup->inputcontrols);
|
||||
free(setup->outputcontrolsmap);
|
||||
free(setup->outputcontrols);
|
||||
free(setup->inputs);
|
||||
free(setup->outputs);
|
||||
|
||||
if (setup->inbufs) {
|
||||
for(i=0; i<setup->nch; i++) {
|
||||
if (setup->inbufs[i])
|
||||
free(setup->inbufs[i]);
|
||||
}
|
||||
for(i=0; i<setup->nch; i++)
|
||||
free(setup->inbufs[i]);
|
||||
free(setup->inbufs);
|
||||
}
|
||||
|
||||
if (setup->outbufs) {
|
||||
for(i=0; i<setup->nch; i++) {
|
||||
if (setup->outbufs[i])
|
||||
free(setup->outbufs[i]);
|
||||
}
|
||||
for(i=0; i<setup->nch; i++)
|
||||
free(setup->outbufs[i]);
|
||||
free(setup->outbufs);
|
||||
}
|
||||
|
||||
@ -753,17 +740,13 @@ static af_data_t* play(struct af_instance_s *af, af_data_t *data) {
|
||||
setup->myname);
|
||||
|
||||
if(setup->inbufs) {
|
||||
for(i=0; i<setup->nch; i++) {
|
||||
if(setup->inbufs[i])
|
||||
free(setup->inbufs[i]);
|
||||
}
|
||||
for(i=0; i<setup->nch; i++)
|
||||
free(setup->inbufs[i]);
|
||||
free(setup->inbufs);
|
||||
}
|
||||
if(setup->outbufs) {
|
||||
for(i=0; i<setup->nch; i++) {
|
||||
if(setup->outbufs[i])
|
||||
free(setup->outbufs[i]);
|
||||
}
|
||||
for(i=0; i<setup->nch; i++)
|
||||
free(setup->outbufs[i]);
|
||||
free(setup->outbufs);
|
||||
}
|
||||
} /* everything is freed */
|
||||
|
@ -144,8 +144,7 @@ static void uninit(struct af_instance_s* af)
|
||||
if(af->data)
|
||||
free(af->data->audio);
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
// Filter data through filter
|
||||
|
@ -236,8 +236,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
fc = 1/(float)(max(s->up,s->dn));
|
||||
// Allocate space for polyphase filter bank and prototype filter
|
||||
w = malloc(sizeof(float) * s->up *L);
|
||||
if(NULL != s->w)
|
||||
free(s->w);
|
||||
free(s->w);
|
||||
s->w = malloc(L*s->up*af->data->bps);
|
||||
|
||||
// Design prototype filter type using Kaiser window with beta = 10
|
||||
|
@ -98,9 +98,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -123,9 +123,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -109,10 +109,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
}
|
||||
|
||||
// Free previous delay queues
|
||||
if(s->dl)
|
||||
free(s->dl);
|
||||
if(s->dr)
|
||||
free(s->dr);
|
||||
free(s->dl);
|
||||
free(s->dr);
|
||||
// Allocate new delay queues
|
||||
s->dl = calloc(LD,af->data->bps);
|
||||
s->dr = calloc(LD,af->data->bps);
|
||||
|
@ -60,12 +60,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup){
|
||||
af_sweept *s = af->setup;
|
||||
free(s);
|
||||
}
|
||||
free(af->data);
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
// Filter data through filter
|
||||
|
@ -116,9 +116,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -133,9 +133,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
||||
// Deallocate memory
|
||||
static void uninit(struct af_instance_s* af)
|
||||
{
|
||||
if(af->data)
|
||||
free(af->data);
|
||||
if(af->setup)
|
||||
free(af->setup);
|
||||
}
|
||||
|
||||
|
@ -728,7 +728,7 @@ static int OpenSPDIF(void)
|
||||
ao_msg(MSGT_AO, MSGL_WARN,
|
||||
"Could not retrieve the original stream format: [%4.4s]\n",
|
||||
(char *)&err);
|
||||
if (p_format_list) free(p_format_list);
|
||||
free(p_format_list);
|
||||
continue;
|
||||
}
|
||||
ao->b_revert = 1;
|
||||
@ -755,9 +755,9 @@ static int OpenSPDIF(void)
|
||||
ao->stream_format = p_format_list[i_current_rate_format];
|
||||
else ao->stream_format = p_format_list[i_backup_rate_format]; /* And if we have to, any digital format will be just fine (highest rate possible). */
|
||||
}
|
||||
if (p_format_list) free(p_format_list);
|
||||
free(p_format_list);
|
||||
}
|
||||
if (p_streams) free(p_streams);
|
||||
free(p_streams);
|
||||
|
||||
if (ao->i_stream_index < 0)
|
||||
{
|
||||
|
@ -218,8 +218,7 @@ static void uninit(int immed){
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
if (ao_outputfilename)
|
||||
free(ao_outputfilename);
|
||||
free(ao_outputfilename);
|
||||
ao_outputfilename = NULL;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ static int realtime_samplecounter_available(char *dev)
|
||||
|
||||
|
||||
error:
|
||||
if (silence != NULL) free(silence);
|
||||
free(silence);
|
||||
if (fd >= 0) {
|
||||
// remove the 0 bytes from the above measurement from the
|
||||
// audio driver's STREAMS queue
|
||||
|
@ -143,10 +143,8 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate
|
||||
while(ao_list[0][0]){
|
||||
char* ao=ao_list[0];
|
||||
int ao_len;
|
||||
if (ao_subdevice) {
|
||||
free(ao_subdevice);
|
||||
ao_subdevice = NULL;
|
||||
}
|
||||
free(ao_subdevice);
|
||||
ao_subdevice = NULL;
|
||||
ao_subdevice=strchr(ao,':');
|
||||
if(ao_subdevice){
|
||||
ao_len = ao_subdevice - ao;
|
||||
@ -175,10 +173,8 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate
|
||||
++ao_list;
|
||||
if(!(ao_list[0])) return NULL; // do NOT fallback to others
|
||||
}
|
||||
if (ao_subdevice) {
|
||||
free(ao_subdevice);
|
||||
ao_subdevice = NULL;
|
||||
}
|
||||
free(ao_subdevice);
|
||||
ao_subdevice = NULL;
|
||||
|
||||
mp_tmsg(MSGT_AO, MSGL_V, "Trying every known audio driver...\n");
|
||||
|
||||
|
@ -126,7 +126,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig)
|
||||
if(!name) {
|
||||
mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] Menu definitions need a name attribute (line %d).\n",parser->line);
|
||||
free(element);
|
||||
if(body) free(body);
|
||||
free(body);
|
||||
asx_free_attribs(attribs);
|
||||
continue;
|
||||
}
|
||||
@ -217,7 +217,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig)
|
||||
} else {
|
||||
mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] unknown menu type '%s' at line %d\n",element,parser->line);
|
||||
free(name);
|
||||
if(body) free(body);
|
||||
free(body);
|
||||
}
|
||||
|
||||
free(element);
|
||||
@ -285,7 +285,7 @@ void menu_uninit(void) {
|
||||
for(i = 0 ; menu_list && menu_list[i].name ; i++) {
|
||||
free(menu_list[i].name);
|
||||
m_struct_free(&menu_list[i].type->priv_st,menu_list[i].cfg);
|
||||
if(menu_list[i].args) free(menu_list[i].args);
|
||||
free(menu_list[i].args);
|
||||
}
|
||||
free(menu_list);
|
||||
menu_count = 0;
|
||||
|
@ -93,14 +93,10 @@ static void read_cmd(menu_t* menu,int cmd) {
|
||||
}
|
||||
|
||||
static void free_entry(list_entry_t* entry) {
|
||||
if(entry->ok)
|
||||
free(entry->ok);
|
||||
if(entry->cancel)
|
||||
free(entry->cancel);
|
||||
if(entry->left)
|
||||
free(entry->left);
|
||||
if(entry->right)
|
||||
free(entry->right);
|
||||
free(entry->ok);
|
||||
free(entry->cancel);
|
||||
free(entry->left);
|
||||
free(entry->right);
|
||||
free(entry->p.txt);
|
||||
free(entry);
|
||||
}
|
||||
@ -132,7 +128,7 @@ static int parse_args(menu_t* menu,char* args) {
|
||||
if(!name) {
|
||||
mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] List menu entry definitions need a name (line %d).\n",parser->line);
|
||||
free(element);
|
||||
if(body) free(body);
|
||||
free(body);
|
||||
asx_free_attribs(attribs);
|
||||
continue;
|
||||
}
|
||||
@ -145,7 +141,7 @@ static int parse_args(menu_t* menu,char* args) {
|
||||
menu_list_add_entry(menu,m);
|
||||
|
||||
free(element);
|
||||
if(body) free(body);
|
||||
free(body);
|
||||
asx_free_attribs(attribs);
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ static void add_line(struct menu_priv_s* priv, char* l) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(priv->num_lines >= priv->buf_lines && priv->lines[priv->last_line])
|
||||
if(priv->num_lines >= priv->buf_lines)
|
||||
free(priv->lines[priv->last_line]);
|
||||
else
|
||||
priv->num_lines++;
|
||||
|
@ -238,8 +238,7 @@ static int open_dir(menu_t* menu,char* args) {
|
||||
|
||||
menu_list_init(menu);
|
||||
|
||||
if(mpriv->dir)
|
||||
free(mpriv->dir);
|
||||
free(mpriv->dir);
|
||||
mpriv->dir = strdup(args);
|
||||
if(mpriv->p.title && mpriv->p.title != mpriv->title && mpriv->p.title != cfg_dflt.p.title)
|
||||
free(mpriv->p.title);
|
||||
|
@ -83,7 +83,7 @@ static void entry_set_text(menu_t* menu, list_entry_t* e) {
|
||||
mp_property_print(e->prop, menu->ctx);
|
||||
int l,edit = (mpriv->edit && e == mpriv->p.current);
|
||||
if(!val || !val[0]) {
|
||||
if(val) free(val);
|
||||
free(val);
|
||||
if(mpriv->hide_na) {
|
||||
e->p.hide = 1;
|
||||
return;
|
||||
@ -92,7 +92,7 @@ static void entry_set_text(menu_t* menu, list_entry_t* e) {
|
||||
} else if(mpriv->hide_na)
|
||||
e->p.hide = 0;
|
||||
l = strlen(e->name) + 2 + strlen(val) + (edit ? 4 : 0) + 1;
|
||||
if(e->p.txt) free(e->p.txt);
|
||||
free(e->p.txt);
|
||||
e->p.txt = malloc(l);
|
||||
sprintf(e->p.txt,"%s: %s%s%s",e->name,edit ? "> " : "",val,edit ? " <" : "");
|
||||
free(val);
|
||||
@ -153,7 +153,8 @@ static int parse_args(menu_t* menu,char* args) {
|
||||
txt = asx_get_attrib("txt",attribs);
|
||||
if(!(name || txt)) {
|
||||
mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,"[MENU] Pref menu entry definitions need a valid 'property' or 'txt' attribute (line %d).\n",parser->line);
|
||||
if(txt) free(txt), txt = NULL;
|
||||
free(txt);
|
||||
txt = NULL;
|
||||
goto next_element;
|
||||
}
|
||||
m = calloc(1,sizeof(struct list_entry_s));
|
||||
@ -176,8 +177,8 @@ static int parse_args(menu_t* menu,char* args) {
|
||||
|
||||
next_element:
|
||||
free(element);
|
||||
if(body) free(body);
|
||||
if(name) free(name);
|
||||
free(body);
|
||||
free(name);
|
||||
asx_free_attribs(attribs);
|
||||
}
|
||||
}
|
||||
@ -253,10 +254,10 @@ static void read_cmd(menu_t* menu,int cmd) {
|
||||
|
||||
static void free_entry(list_entry_t* entry) {
|
||||
free(entry->p.txt);
|
||||
if(entry->name) free(entry->name);
|
||||
if(entry->txt) free(entry->txt);
|
||||
if(entry->prop) free(entry->prop);
|
||||
if(entry->menu) free(entry->menu);
|
||||
free(entry->name);
|
||||
free(entry->txt);
|
||||
free(entry->prop);
|
||||
free(entry->menu);
|
||||
free(entry);
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,7 @@ static int preinit(sh_audio_t *sh) {
|
||||
}
|
||||
|
||||
static void uninit(sh_audio_t *sh) {
|
||||
if (sh->context)
|
||||
free(sh->context);
|
||||
free(sh->context);
|
||||
sh->context = NULL;
|
||||
}
|
||||
|
||||
|
@ -126,8 +126,7 @@ static void uninit(sh_audio_t *sh) {
|
||||
if (ctx) {
|
||||
speex_bits_destroy(&ctx->bits);
|
||||
speex_decoder_destroy(ctx->dec_context);
|
||||
if (ctx->hdr)
|
||||
free(ctx->hdr);
|
||||
free(ctx->hdr);
|
||||
free(ctx);
|
||||
}
|
||||
ctx = NULL;
|
||||
|
@ -1100,8 +1100,7 @@ static int decode_pkt0(priv_vbi_t* priv,unsigned char* data,int magAddr)
|
||||
if(d[i]&0x80){
|
||||
pll_add(priv,2,4);
|
||||
|
||||
if(priv->mag[magAddr].pt)
|
||||
free(priv->mag[magAddr].pt);
|
||||
free(priv->mag[magAddr].pt);
|
||||
priv->mag[magAddr].pt=NULL;
|
||||
priv->mag[magAddr].order=0;
|
||||
return 0;
|
||||
@ -1753,10 +1752,8 @@ int teletext_control(void* p, int cmd, void *arg)
|
||||
}
|
||||
case TV_VBI_CONTROL_STOP:
|
||||
{
|
||||
if(priv->mag)
|
||||
free(priv->mag);
|
||||
if(priv->ptsp)
|
||||
free(priv->ptsp);
|
||||
free(priv->mag);
|
||||
free(priv->ptsp);
|
||||
destroy_cache(priv);
|
||||
priv->page_changed=1;
|
||||
pthread_mutex_destroy(&priv->buffer_mutex);
|
||||
|
@ -191,7 +191,7 @@ void free_mp_image(mp_image_t* mpi){
|
||||
if(!mpi) return;
|
||||
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
|
||||
/* becouse we allocate the whole image in once */
|
||||
if(mpi->planes[0]) av_free(mpi->planes[0]);
|
||||
av_free(mpi->planes[0]);
|
||||
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
|
||||
av_free(mpi->planes[1]);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ static void uninit(sh_video_t *sh){
|
||||
int i;
|
||||
vd_libmpeg2_ctx_t *context = sh->context;
|
||||
mpeg2dec_t * mpeg2dec = context->mpeg2dec;
|
||||
if (mpeg2dec->pending_buffer) free(mpeg2dec->pending_buffer);
|
||||
free(mpeg2dec->pending_buffer);
|
||||
mpeg2dec->decoder.convert=NULL;
|
||||
mpeg2dec->decoder.convert_id=NULL;
|
||||
mpeg2_close (mpeg2dec);
|
||||
|
@ -375,8 +375,7 @@ static void uninit(sh_video_t *sh){
|
||||
#endif
|
||||
rv_handle=NULL;
|
||||
initialized = 0;
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
bufsz = 0;
|
||||
}
|
||||
@ -406,7 +405,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
if(len<=0 || flags&2) return NULL; // skipped frame || hardframedrop
|
||||
|
||||
if (bufsz < sh->disp_w*sh->disp_h*3/2) {
|
||||
if (buffer) free(buffer);
|
||||
free(buffer);
|
||||
bufsz = sh->disp_w*sh->disp_h*3/2;
|
||||
buffer=malloc(bufsz);
|
||||
if (!buffer) return 0;
|
||||
|
@ -771,8 +771,7 @@ static void uninit(sh_video_t *sh)
|
||||
close_func();
|
||||
}
|
||||
dlclose(priv->file_handler);
|
||||
if (priv->decinfo != NULL)
|
||||
free(priv->decinfo);
|
||||
free(priv->decinfo);
|
||||
free(priv);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ static int control(struct vf_instance *vf, int request, void* data){
|
||||
}
|
||||
|
||||
static void uninit(struct vf_instance *vf) {
|
||||
if (vf->priv) free(vf->priv);
|
||||
free(vf->priv);
|
||||
}
|
||||
|
||||
static int vf_open(vf_instance_t *vf, char *args){
|
||||
|
@ -49,7 +49,7 @@ static int config(struct vf_instance *vf,
|
||||
int width, int height, int d_width, int d_height,
|
||||
unsigned int flags, unsigned int outfmt){
|
||||
|
||||
if(vf->priv->Line) free(vf->priv->Line);
|
||||
free(vf->priv->Line);
|
||||
vf->priv->Line = malloc(width);
|
||||
vf->priv->pmpi=NULL;
|
||||
// vf->default_caps &= !VFCAP_ACCEPT_STRIDE;
|
||||
|
@ -215,7 +215,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
|
||||
|
||||
static void uninit(struct vf_instance *vf)
|
||||
{
|
||||
if (vf->priv->buf) free(vf->priv->buf);
|
||||
free(vf->priv->buf);
|
||||
free(vf->priv);
|
||||
}
|
||||
|
||||
|
@ -576,13 +576,13 @@ static void uninit(struct vf_instance *vf)
|
||||
{
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->temp) av_free(vf->priv->temp);
|
||||
av_free(vf->priv->temp);
|
||||
vf->priv->temp= NULL;
|
||||
if(vf->priv->src) av_free(vf->priv->src);
|
||||
av_free(vf->priv->src);
|
||||
vf->priv->src= NULL;
|
||||
//if(vf->priv->avctx) free(vf->priv->avctx);
|
||||
//free(vf->priv->avctx);
|
||||
//vf->priv->avctx= NULL;
|
||||
if(vf->priv->non_b_qp) free(vf->priv->non_b_qp);
|
||||
free(vf->priv->non_b_qp);
|
||||
vf->priv->non_b_qp= NULL;
|
||||
|
||||
av_free(vf->priv);
|
||||
|
@ -128,8 +128,6 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
}
|
||||
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
av_free(vf->priv);
|
||||
vf->priv=NULL;
|
||||
}
|
||||
|
@ -44,11 +44,17 @@ struct vf_priv_s {
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(vf->priv->Line){free(vf->priv->Line);vf->priv->Line=NULL;}
|
||||
if(vf->priv->Frame[0]){free(vf->priv->Frame[0]);vf->priv->Frame[0]=NULL;}
|
||||
if(vf->priv->Frame[1]){free(vf->priv->Frame[1]);vf->priv->Frame[1]=NULL;}
|
||||
if(vf->priv->Frame[2]){free(vf->priv->Frame[2]);vf->priv->Frame[2]=NULL;}
|
||||
static void uninit(struct vf_instance *vf)
|
||||
{
|
||||
free(vf->priv->Line);
|
||||
free(vf->priv->Frame[0]);
|
||||
free(vf->priv->Frame[1]);
|
||||
free(vf->priv->Frame[2]);
|
||||
|
||||
vf->priv->Line = NULL;
|
||||
vf->priv->Frame[0] = NULL;
|
||||
vf->priv->Frame[1] = NULL;
|
||||
vf->priv->Frame[2] = NULL;
|
||||
}
|
||||
|
||||
static int config(struct vf_instance *vf,
|
||||
|
@ -158,8 +158,8 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
|
||||
|
||||
static void uninit(struct vf_instance *vf)
|
||||
{
|
||||
if (vf->priv->buf[0]) free(vf->priv->buf[0]);
|
||||
if (vf->priv->buf[1]) free(vf->priv->buf[1]);
|
||||
free(vf->priv->buf[0]);
|
||||
free(vf->priv->buf[1]);
|
||||
free(vf->priv);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ static int config(struct vf_instance *vf,
|
||||
}
|
||||
}
|
||||
|
||||
if(vf->priv->outbuf) free(vf->priv->outbuf);
|
||||
free(vf->priv->outbuf);
|
||||
|
||||
vf->priv->outbuf_size=10000+width*height; // must be enough!
|
||||
vf->priv->outbuf = malloc(vf->priv->outbuf_size);
|
||||
|
@ -273,9 +273,9 @@ static void uninit(struct vf_instance *vf){
|
||||
|
||||
#if 0
|
||||
for(i=0; i<3; i++){
|
||||
if(vf->priv->temp[i]) free(vf->priv->temp[i]);
|
||||
free(vf->priv->temp[i]);
|
||||
vf->priv->temp[i]= NULL;
|
||||
if(vf->priv->src[i]) free(vf->priv->src[i]);
|
||||
free(vf->priv->src[i]);
|
||||
vf->priv->src[i]= NULL;
|
||||
}
|
||||
#endif
|
||||
|
@ -370,10 +370,10 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->chromaParam.noise) av_free(vf->priv->chromaParam.noise);
|
||||
av_free(vf->priv->chromaParam.noise);
|
||||
vf->priv->chromaParam.noise= NULL;
|
||||
|
||||
if(vf->priv->lumaParam.noise) av_free(vf->priv->lumaParam.noise);
|
||||
av_free(vf->priv->lumaParam.noise);
|
||||
vf->priv->lumaParam.noise= NULL;
|
||||
|
||||
free(vf->priv);
|
||||
|
@ -132,7 +132,7 @@ static int config(struct vf_instance *vf,
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->pv) free(vf->priv->pv);
|
||||
free(vf->priv->pv);
|
||||
vf->priv->pv= NULL;
|
||||
|
||||
free(vf->priv);
|
||||
|
@ -410,7 +410,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->src) free(vf->priv->src);
|
||||
free(vf->priv->src);
|
||||
vf->priv->src= NULL;
|
||||
|
||||
free(vf->priv);
|
||||
|
@ -144,7 +144,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->qp) av_free(vf->priv->qp);
|
||||
av_free(vf->priv->qp);
|
||||
vf->priv->qp= NULL;
|
||||
|
||||
av_free(vf->priv);
|
||||
|
@ -153,10 +153,10 @@ static void freeBuffers(FilterParam *f){
|
||||
if(f->preFilterContext) sws_freeContext(f->preFilterContext);
|
||||
f->preFilterContext=NULL;
|
||||
|
||||
if(f->preFilterBuf) free(f->preFilterBuf);
|
||||
free(f->preFilterBuf);
|
||||
f->preFilterBuf=NULL;
|
||||
|
||||
if(f->distCoeff) free(f->distCoeff);
|
||||
free(f->distCoeff);
|
||||
f->distCoeff=NULL;
|
||||
}
|
||||
|
||||
|
@ -303,10 +303,8 @@ static int config(struct vf_instance *vf,
|
||||
}
|
||||
vf->priv->fmt=best;
|
||||
|
||||
if(vf->priv->palette){
|
||||
free(vf->priv->palette);
|
||||
vf->priv->palette=NULL;
|
||||
}
|
||||
free(vf->priv->palette);
|
||||
vf->priv->palette=NULL;
|
||||
switch(best){
|
||||
case IMGFMT_RGB8: {
|
||||
/* set 332 palette for 8 bpp */
|
||||
@ -526,7 +524,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(vf->priv->ctx) sws_freeContext(vf->priv->ctx);
|
||||
if(vf->priv->ctx2) sws_freeContext(vf->priv->ctx2);
|
||||
if(vf->priv->palette) free(vf->priv->palette);
|
||||
free(vf->priv->palette);
|
||||
free(vf->priv);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ static int config(struct vf_instance *vf,
|
||||
vf->priv->dh = d_height;
|
||||
vf->priv->stride = (3*vf->priv->dw+15)&~15;
|
||||
|
||||
if (vf->priv->buffer) free(vf->priv->buffer); // probably reconfigured
|
||||
free(vf->priv->buffer); // probably reconfigured
|
||||
vf->priv->buffer = NULL;
|
||||
|
||||
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
|
||||
@ -278,7 +278,7 @@ static void uninit(vf_instance_t *vf)
|
||||
avcodec_close(vf->priv->avctx);
|
||||
av_freep(&vf->priv->avctx);
|
||||
if(vf->priv->ctx) sws_freeContext(vf->priv->ctx);
|
||||
if (vf->priv->buffer) av_free(vf->priv->buffer);
|
||||
av_free(vf->priv->buffer);
|
||||
free(vf->priv->outbuffer);
|
||||
free(vf->priv);
|
||||
}
|
||||
|
@ -515,13 +515,13 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
if(vf->priv->temp) free(vf->priv->temp);
|
||||
free(vf->priv->temp);
|
||||
vf->priv->temp= NULL;
|
||||
if(vf->priv->src) free(vf->priv->src);
|
||||
free(vf->priv->src);
|
||||
vf->priv->src= NULL;
|
||||
if(vf->priv->avctx) free(vf->priv->avctx);
|
||||
free(vf->priv->avctx);
|
||||
vf->priv->avctx= NULL;
|
||||
if(vf->priv->non_b_qp) free(vf->priv->non_b_qp);
|
||||
free(vf->priv->non_b_qp);
|
||||
vf->priv->non_b_qp= NULL;
|
||||
|
||||
free(vf->priv);
|
||||
|
@ -212,12 +212,12 @@ static void uninit( struct vf_instance *vf ) {
|
||||
|
||||
fp = &vf->priv->lumaParam;
|
||||
for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
|
||||
if( fp->SC[z] ) av_free( fp->SC[z] );
|
||||
av_free( fp->SC[z] );
|
||||
fp->SC[z] = NULL;
|
||||
}
|
||||
fp = &vf->priv->chromaParam;
|
||||
for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
|
||||
if( fp->SC[z] ) av_free( fp->SC[z] );
|
||||
av_free( fp->SC[z] );
|
||||
fp->SC[z] = NULL;
|
||||
}
|
||||
|
||||
|
@ -303,9 +303,9 @@ static void uninit(struct vf_instance *vf){
|
||||
if(!vf->priv) return;
|
||||
|
||||
for(i=0; i<3; i++){
|
||||
if(vf->priv->temp[i]) free(vf->priv->temp[i]);
|
||||
free(vf->priv->temp[i]);
|
||||
vf->priv->temp[i]= NULL;
|
||||
if(vf->priv->src[i]) free(vf->priv->src[i]);
|
||||
free(vf->priv->src[i]);
|
||||
vf->priv->src[i]= NULL;
|
||||
}
|
||||
for(i=0; i<BLOCK*BLOCK; i++){
|
||||
|
@ -709,7 +709,7 @@ return 1;
|
||||
len_err_out:
|
||||
mp_tmsg(MSGT_HEADER, MSGL_FATAL, "Invalid length in ASF header!\n");
|
||||
err_out:
|
||||
if (hdr) free(hdr);
|
||||
if (streams) free(streams);
|
||||
free(hdr);
|
||||
free(streams);
|
||||
return 0;
|
||||
}
|
||||
|
@ -64,8 +64,7 @@ static void demux_close_aac(demuxer_t *demuxer)
|
||||
if(!priv)
|
||||
return;
|
||||
|
||||
if(priv->buf)
|
||||
free(priv->buf);
|
||||
free(priv->buf);
|
||||
|
||||
free(demuxer->priv);
|
||||
|
||||
|
@ -673,12 +673,8 @@ static void demux_close_asf(demuxer_t *demuxer) {
|
||||
|
||||
if (!asf) return;
|
||||
|
||||
if (asf->aud_repdata_sizes)
|
||||
free(asf->aud_repdata_sizes);
|
||||
|
||||
if (asf->vid_repdata_sizes)
|
||||
free(asf->vid_repdata_sizes);
|
||||
|
||||
free(asf->aud_repdata_sizes);
|
||||
free(asf->vid_repdata_sizes);
|
||||
free(asf);
|
||||
}
|
||||
|
||||
|
@ -668,8 +668,6 @@ static void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_
|
||||
static void demux_close_audio(demuxer_t* demuxer) {
|
||||
da_priv_t* priv = demuxer->priv;
|
||||
|
||||
if(!priv)
|
||||
return;
|
||||
free(priv);
|
||||
}
|
||||
|
||||
|
@ -457,8 +457,7 @@ static void demux_close_film(demuxer_t* demuxer) {
|
||||
|
||||
if(!film_data)
|
||||
return;
|
||||
if(film_data->chunks)
|
||||
free(film_data->chunks);
|
||||
free(film_data->chunks);
|
||||
free(film_data);
|
||||
|
||||
}
|
||||
|
@ -190,11 +190,8 @@ static void demux_close_fli(demuxer_t* demuxer) {
|
||||
if(!frames)
|
||||
return;
|
||||
|
||||
if(frames->filepos)
|
||||
free(frames->filepos);
|
||||
if(frames->frame_size)
|
||||
free(frames->frame_size);
|
||||
|
||||
free(frames->filepos);
|
||||
free(frames->frame_size);
|
||||
free(frames);
|
||||
|
||||
}
|
||||
|
@ -179,8 +179,6 @@ static demuxer_t* demux_open_mf(demuxer_t* demuxer){
|
||||
static void demux_close_mf(demuxer_t* demuxer) {
|
||||
mf_t *mf = demuxer->priv;
|
||||
|
||||
if(!mf)
|
||||
return;
|
||||
free(mf);
|
||||
}
|
||||
|
||||
|
@ -475,8 +475,7 @@ static void demux_mng_close(demuxer_t* demuxer)
|
||||
mng_cleanup(&mng_priv->h_mng);
|
||||
|
||||
// free private data
|
||||
if (mng_priv->canvas)
|
||||
free(mng_priv->canvas);
|
||||
free(mng_priv->canvas);
|
||||
|
||||
free(mng_priv);
|
||||
}
|
||||
|
@ -199,8 +199,6 @@ static void demux_mpc_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_de
|
||||
static void demux_close_mpc(demuxer_t* demuxer) {
|
||||
da_priv_t* priv = demuxer->priv;
|
||||
|
||||
if(!priv)
|
||||
return;
|
||||
free(priv);
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ static demuxer_t* demux_mpg_open(demuxer_t* demuxer) {
|
||||
|
||||
static void demux_close_mpg(demuxer_t* demuxer) {
|
||||
mpg_demuxer_t* mpg_d = demuxer->priv;
|
||||
if (mpg_d) free(mpg_d);
|
||||
free(mpg_d);
|
||||
}
|
||||
|
||||
|
||||
|
@ -322,8 +322,6 @@ static int nsv_check_file ( demuxer_t* demuxer )
|
||||
static void demux_close_nsv(demuxer_t* demuxer) {
|
||||
nsv_priv_t* priv = demuxer->priv;
|
||||
|
||||
if(!priv)
|
||||
return;
|
||||
free(priv);
|
||||
|
||||
}
|
||||
|
@ -436,11 +436,10 @@ static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os,
|
||||
sh_sub_t *sh;
|
||||
|
||||
// in case of malicious files with more than one lang per track:
|
||||
if (ogg_d->text_langs[index])
|
||||
free(ogg_d->text_langs[index]);
|
||||
free(ogg_d->text_langs[index]);
|
||||
ogg_d->text_langs[index] = strdup(val);
|
||||
sh = d->s_streams[index];
|
||||
if (sh && sh->lang)
|
||||
if (sh)
|
||||
free(sh->lang);
|
||||
if (sh)
|
||||
sh->lang = strdup(val);
|
||||
@ -1606,13 +1605,11 @@ static void demux_close_ogg(demuxer_t *demuxer)
|
||||
}
|
||||
free(ogg_d->subs);
|
||||
}
|
||||
if (ogg_d->syncpoints)
|
||||
free(ogg_d->syncpoints);
|
||||
if (ogg_d->text_ids)
|
||||
free(ogg_d->text_ids);
|
||||
free(ogg_d->syncpoints);
|
||||
free(ogg_d->text_ids);
|
||||
if (ogg_d->text_langs) {
|
||||
for (i = 0; i < ogg_d->n_text; i++)
|
||||
if (ogg_d->text_langs[i]) free(ogg_d->text_langs[i]);
|
||||
free(ogg_d->text_langs[i]);
|
||||
free(ogg_d->text_langs);
|
||||
}
|
||||
free(ogg_d);
|
||||
|
@ -515,11 +515,8 @@ static void demux_seek_pva(demuxer_t * demuxer,float rel_seek_secs,float audio_d
|
||||
|
||||
static void demux_close_pva(demuxer_t * demuxer)
|
||||
{
|
||||
if(demuxer->priv)
|
||||
{
|
||||
free(demuxer->priv);
|
||||
demuxer->priv=NULL;
|
||||
}
|
||||
free(demuxer->priv);
|
||||
demuxer->priv = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1625,8 +1625,7 @@ skip_this_chunk:
|
||||
#else
|
||||
stream_skip(demuxer->stream, codec_data_size - tmp);
|
||||
#endif
|
||||
if (mimet)
|
||||
free (mimet);
|
||||
free (mimet);
|
||||
break;
|
||||
// }
|
||||
}
|
||||
@ -1765,12 +1764,9 @@ static void demux_close_real(demuxer_t *demuxer)
|
||||
|
||||
if (priv){
|
||||
for(i=0; i<MAX_STREAMS; i++)
|
||||
if(priv->index_table[i])
|
||||
free(priv->index_table[i]);
|
||||
if (priv->audio_buf)
|
||||
free(priv->audio_buf);
|
||||
if (priv->audio_timestamp)
|
||||
free(priv->audio_timestamp);
|
||||
free(priv->index_table[i]);
|
||||
free(priv->audio_buf);
|
||||
free(priv->audio_timestamp);
|
||||
free(priv);
|
||||
}
|
||||
|
||||
|
@ -333,14 +333,12 @@ static demuxer_t* demux_open_ra(demuxer_t* demuxer)
|
||||
|
||||
static void demux_close_ra(demuxer_t *demuxer)
|
||||
{
|
||||
ra_priv_t* ra_priv = demuxer->priv;
|
||||
ra_priv_t* ra_priv = demuxer->priv;
|
||||
|
||||
if (ra_priv) {
|
||||
if (ra_priv->audio_buf)
|
||||
free (ra_priv->audio_buf);
|
||||
free(ra_priv);
|
||||
free(ra_priv->audio_buf);
|
||||
free(ra_priv);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -259,8 +259,6 @@ static demuxer_t* demux_open_roq(demuxer_t* demuxer)
|
||||
static void demux_close_roq(demuxer_t* demuxer) {
|
||||
roq_data_t *roq_data = demuxer->priv;
|
||||
|
||||
if(!roq_data)
|
||||
return;
|
||||
free(roq_data);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ static unsigned char* parseH264ConfigStr( char const* configStr,
|
||||
|
||||
psz += strlen(psz)+1;
|
||||
}
|
||||
if( dup ) free( dup );
|
||||
free( dup );
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
@ -1102,19 +1102,15 @@ static void demux_close_ts(demuxer_t * demuxer)
|
||||
|
||||
if(priv)
|
||||
{
|
||||
if(priv->pat.section.buffer)
|
||||
free(priv->pat.section.buffer);
|
||||
if(priv->pat.progs)
|
||||
free(priv->pat.progs);
|
||||
free(priv->pat.section.buffer);
|
||||
free(priv->pat.progs);
|
||||
|
||||
if(priv->pmt)
|
||||
{
|
||||
for(i = 0; i < priv->pmt_cnt; i++)
|
||||
{
|
||||
if(priv->pmt[i].section.buffer)
|
||||
free(priv->pmt[i].section.buffer);
|
||||
if(priv->pmt[i].es)
|
||||
free(priv->pmt[i].es);
|
||||
free(priv->pmt[i].section.buffer);
|
||||
free(priv->pmt[i].es);
|
||||
}
|
||||
free(priv->pmt);
|
||||
}
|
||||
|
@ -230,12 +230,9 @@ static void vivo_parse_text_header(demuxer_t *demux, int header_len)
|
||||
token = strtok(NULL, (char *)&("\x0d\x0a"));
|
||||
}
|
||||
|
||||
if (buf)
|
||||
free(buf);
|
||||
if (opt)
|
||||
free(opt);
|
||||
if (param)
|
||||
free(param);
|
||||
free(buf);
|
||||
free(opt);
|
||||
free(param);
|
||||
}
|
||||
|
||||
static int vivo_check_file(demuxer_t* demuxer){
|
||||
@ -745,14 +742,10 @@ static void demux_close_vivo(demuxer_t *demuxer)
|
||||
vivo_priv_t* priv=demuxer->priv;
|
||||
|
||||
if (priv) {
|
||||
if (priv->title)
|
||||
free(priv->title);
|
||||
if (priv->author)
|
||||
free(priv->author);
|
||||
if (priv->copyright)
|
||||
free(priv->copyright);
|
||||
if (priv->producer)
|
||||
free(priv->producer);
|
||||
free(priv->title);
|
||||
free(priv->author);
|
||||
free(priv->copyright);
|
||||
free(priv->producer);
|
||||
free(priv);
|
||||
}
|
||||
return;
|
||||
|
@ -313,7 +313,7 @@ static inline void resize_demux_packet(demux_packet_t* dp, int len)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dp->buffer) free(dp->buffer);
|
||||
free(dp->buffer);
|
||||
dp->buffer=NULL;
|
||||
}
|
||||
dp->len=len;
|
||||
@ -338,7 +338,7 @@ static inline void free_demux_packet(demux_packet_t* dp){
|
||||
if (dp->master==NULL){ //dp is a master packet
|
||||
dp->refcount--;
|
||||
if (dp->refcount==0){
|
||||
if (dp->buffer) free(dp->buffer);
|
||||
free(dp->buffer);
|
||||
free(dp);
|
||||
}
|
||||
return;
|
||||
|
@ -1144,8 +1144,7 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char
|
||||
default:
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "[gl] unknown conversion type %i\n", conv);
|
||||
}
|
||||
if (lookup_data)
|
||||
free(lookup_data);
|
||||
free(lookup_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1084,8 +1084,8 @@ void osd_free(struct osd_state *osd)
|
||||
mp_osd_obj_t* obj=vo_osd_list;
|
||||
while(obj){
|
||||
mp_osd_obj_t* next=obj->next;
|
||||
if (obj->alpha_buffer) free(obj->alpha_buffer);
|
||||
if (obj->bitmap_buffer) free(obj->bitmap_buffer);
|
||||
free(obj->alpha_buffer);
|
||||
free(obj->bitmap_buffer);
|
||||
free(obj);
|
||||
obj=next;
|
||||
}
|
||||
|
@ -643,8 +643,7 @@ range_t *str2range(char *s)
|
||||
r[i].min = r[i].max = -1;
|
||||
return r;
|
||||
out_err:
|
||||
if (r)
|
||||
free(r);
|
||||
free(r);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -651,17 +651,16 @@ static int parse_suboptions(const char *arg) {
|
||||
if (subcolor) aaopt_subcolor = getcolor(subcolor);
|
||||
}
|
||||
|
||||
if (subopts) free(subopts);
|
||||
if (booleans) free(booleans);
|
||||
free(subopts);
|
||||
free(booleans);
|
||||
if (strings) {
|
||||
for (i=0; i<nstrings; i++)
|
||||
if (strings[i])
|
||||
free(strings[i]);
|
||||
free(strings[i]);
|
||||
free(strings);
|
||||
}
|
||||
if (osdcolor) free(osdcolor);
|
||||
if (subcolor) free(subcolor);
|
||||
if (helpmsg) free(helpmsg);
|
||||
free(osdcolor);
|
||||
free(subcolor);
|
||||
free(helpmsg);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ static void uninit(void)
|
||||
[finalPool release];
|
||||
}
|
||||
|
||||
if (buffer_name) free(buffer_name);
|
||||
free(buffer_name);
|
||||
buffer_name = NULL;
|
||||
}
|
||||
|
||||
|
@ -150,10 +150,8 @@ static int query_format(uint32_t format){
|
||||
static void uninit(void){
|
||||
if(!vo_config_count) return;
|
||||
vidix_term();
|
||||
if(vidix_name){
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
}
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
}
|
||||
|
||||
static int preinit(const char *arg){
|
||||
|
@ -1177,8 +1177,7 @@ static void flip_page(void)
|
||||
mp_msg(MSGT_VO,MSGL_WARN,"<vo_directx><WARN>stride changed !!!! disabling direct rendering\n");
|
||||
vo_directrendering=0;
|
||||
}
|
||||
if (tmp_image)
|
||||
free(tmp_image);
|
||||
free(tmp_image);
|
||||
tmp_image = NULL;
|
||||
dstride = ddsdsf.lPitch;
|
||||
image = ddsdsf.lpSurface;
|
||||
|
@ -790,10 +790,8 @@ static void uninit(void)
|
||||
close(dxr2_fd);
|
||||
dxr2_fd = -1;
|
||||
}
|
||||
if(sub_img) {
|
||||
free(sub_img);
|
||||
sub_img = NULL;
|
||||
}
|
||||
free(sub_img);
|
||||
sub_img = NULL;
|
||||
if(sub_vo) {
|
||||
int cc = vo_config_count;
|
||||
vo_config_count = sub_config_count;
|
||||
|
@ -692,12 +692,8 @@ static void uninit(void)
|
||||
close(fd_control);
|
||||
}
|
||||
#ifdef SPU_SUPPORT
|
||||
if(osdpicbuf) {
|
||||
free(osdpicbuf);
|
||||
}
|
||||
if(spued) {
|
||||
free(spued);
|
||||
}
|
||||
free(osdpicbuf);
|
||||
free(spued);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -912,9 +908,7 @@ static overlay_t *overlay_init(int dev)
|
||||
|
||||
static int overlay_release(overlay_t *o)
|
||||
{
|
||||
if(o)
|
||||
free(o);
|
||||
|
||||
free(o);
|
||||
return 0;
|
||||
}
|
||||
#define TYPE_INT 1
|
||||
|
@ -366,10 +366,8 @@ err_out_parse_error:
|
||||
err_out_print_linenum:
|
||||
mp_msg(MSGT_VO, MSGL_V, " at line %d\n", line_num);
|
||||
err_out:
|
||||
if (fb_modes) {
|
||||
free(fb_modes);
|
||||
fb_modes = NULL;
|
||||
}
|
||||
free(fb_modes);
|
||||
fb_modes = NULL;
|
||||
nr_modes = 0;
|
||||
free(line);
|
||||
free(fp);
|
||||
@ -1121,8 +1119,7 @@ static int preinit(const char *vo_subdevice)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (fb_dev_name)
|
||||
free(fb_dev_name);
|
||||
free(fb_dev_name);
|
||||
fb_dev_name = strdup(vo_subdevice);
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static int preinit(const char *subdevice)
|
||||
{
|
||||
if (subdevice)
|
||||
{
|
||||
if (fb_dev_name) free(fb_dev_name);
|
||||
free(fb_dev_name);
|
||||
fb_dev_name = strdup(subdevice);
|
||||
}
|
||||
return fb_preinit(0);
|
||||
@ -413,7 +413,7 @@ static void uninit(void)
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't restore original cmap\n");
|
||||
fb_cmap_changed = 0;
|
||||
}
|
||||
if(next_frame) free(next_frame);
|
||||
free(next_frame);
|
||||
if (fb_dev_fd >= 0) {
|
||||
if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_orig_vinfo))
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't reset original fb_var_screeninfo: %s\n", strerror(errno));
|
||||
|
@ -455,8 +455,7 @@ static int preinit(const char *arg)
|
||||
|
||||
static void uninit(void)
|
||||
{
|
||||
if (ggi_conf.driver)
|
||||
free(ggi_conf.driver);
|
||||
free(ggi_conf.driver);
|
||||
|
||||
#ifdef CONFIG_GGIWMH
|
||||
ggiWmhDetach(ggi_conf.vis);
|
||||
|
@ -362,9 +362,9 @@ static void uninit(void)
|
||||
}
|
||||
|
||||
// free our allocated ram
|
||||
if (gif_filename != NULL) free(gif_filename);
|
||||
if (slice_data != NULL) free(slice_data);
|
||||
if (reduce_data != NULL) free(reduce_data);
|
||||
free(gif_filename);
|
||||
free(slice_data);
|
||||
free(reduce_data);
|
||||
if (reduce_cmap != NULL) FreeMapObject(reduce_cmap);
|
||||
|
||||
// set the pointers back to null.
|
||||
|
@ -1114,9 +1114,9 @@ static void
|
||||
uninit(void)
|
||||
{
|
||||
uninitGl();
|
||||
if (custom_prog) free(custom_prog);
|
||||
free(custom_prog);
|
||||
custom_prog = NULL;
|
||||
if (custom_tex) free(custom_tex);
|
||||
free(custom_tex);
|
||||
custom_tex = NULL;
|
||||
uninit_mpglcontext(&glctx);
|
||||
}
|
||||
|
@ -236,8 +236,7 @@ static int initTextures(void)
|
||||
texpercx = (GLfloat) texture_width / (GLfloat) image_width;
|
||||
texpercy = (GLfloat) texture_height / (GLfloat) image_height;
|
||||
|
||||
if (texgrid)
|
||||
free(texgrid);
|
||||
free(texgrid);
|
||||
texgrid = calloc (texnumx * texnumy, sizeof (struct TexSquare));
|
||||
|
||||
raw_line_len = image_width * image_bytes;
|
||||
@ -826,10 +825,8 @@ static void
|
||||
uninit(void)
|
||||
{
|
||||
if ( !vo_config_count ) return;
|
||||
if (texgrid) {
|
||||
free(texgrid);
|
||||
texgrid = NULL;
|
||||
}
|
||||
free(texgrid);
|
||||
texgrid = NULL;
|
||||
uninit_mpglcontext(&glctx);
|
||||
}
|
||||
|
||||
|
@ -308,14 +308,10 @@ static int query_format(uint32_t format)
|
||||
|
||||
static void uninit(void)
|
||||
{
|
||||
if (jpeg_subdirs) {
|
||||
free(jpeg_subdirs);
|
||||
jpeg_subdirs = NULL;
|
||||
}
|
||||
if (jpeg_outdir) {
|
||||
free(jpeg_outdir);
|
||||
jpeg_outdir = NULL;
|
||||
}
|
||||
free(jpeg_subdirs);
|
||||
jpeg_subdirs = NULL;
|
||||
free(jpeg_outdir);
|
||||
jpeg_outdir = NULL;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -280,10 +280,8 @@ static int control(uint32_t request, void *data)
|
||||
|
||||
static void uninit(void)
|
||||
{
|
||||
if (md5sum_outfile) {
|
||||
free(md5sum_outfile);
|
||||
md5sum_outfile = NULL;
|
||||
}
|
||||
free(md5sum_outfile);
|
||||
md5sum_outfile = NULL;
|
||||
if (md5sum_fd) fclose(md5sum_fd);
|
||||
}
|
||||
|
||||
|
@ -556,14 +556,10 @@ static int control(uint32_t request, void *data)
|
||||
|
||||
static void uninit(void)
|
||||
{
|
||||
if (pnm_subdirs) {
|
||||
free(pnm_subdirs);
|
||||
pnm_subdirs = NULL;
|
||||
}
|
||||
if (pnm_outdir) {
|
||||
free(pnm_outdir);
|
||||
pnm_outdir = NULL;
|
||||
}
|
||||
free(pnm_subdirs);
|
||||
pnm_subdirs = NULL;
|
||||
free(pnm_outdir);
|
||||
pnm_outdir = NULL;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -312,11 +312,8 @@ static void uninit(void){
|
||||
if ( !vo_config_count ) return;
|
||||
vidix_term();
|
||||
|
||||
if (vidix_name){
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
}
|
||||
//
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
}
|
||||
|
||||
static int preinit(const char *arg){
|
||||
|
@ -362,11 +362,8 @@ static void uninit(void)
|
||||
return;
|
||||
vidix_term();
|
||||
|
||||
if (vidix_name)
|
||||
{
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
}
|
||||
free(vidix_name);
|
||||
vidix_name = NULL;
|
||||
|
||||
vo_x11_uninit();
|
||||
}
|
||||
|
@ -234,16 +234,14 @@ static int query_format(uint32_t format)
|
||||
// WARNING: config(...) also uses this
|
||||
static void uninit(void)
|
||||
{
|
||||
if(image)
|
||||
free(image);
|
||||
free(image);
|
||||
image = NULL;
|
||||
|
||||
if(yuv_out)
|
||||
fclose(yuv_out);
|
||||
yuv_out = NULL;
|
||||
|
||||
if (yuv_filename)
|
||||
free(yuv_filename);
|
||||
free(yuv_filename);
|
||||
yuv_filename = NULL;
|
||||
image_width = 0;
|
||||
image_height = 0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user