Commit 1a40dacb authored by Monty's avatar Monty

Numerous small changes to resolve possible and certain issues found by

Coverity.


svn path=/trunk/vorbis/; revision=13162
parent 507df27f
......@@ -326,20 +326,23 @@ void vorbis_dsp_clear(vorbis_dsp_state *v){
}
if(b->flr){
for(i=0;i<ci->floors;i++)
_floor_P[ci->floor_type[i]]->
free_look(b->flr[i]);
if(ci)
for(i=0;i<ci->floors;i++)
_floor_P[ci->floor_type[i]]->
free_look(b->flr[i]);
_ogg_free(b->flr);
}
if(b->residue){
for(i=0;i<ci->residues;i++)
_residue_P[ci->residue_type[i]]->
free_look(b->residue[i]);
if(ci)
for(i=0;i<ci->residues;i++)
_residue_P[ci->residue_type[i]]->
free_look(b->residue[i]);
_ogg_free(b->residue);
}
if(b->psy){
for(i=0;i<ci->psys;i++)
_vp_psy_clear(b->psy+i);
if(ci)
for(i=0;i<ci->psys;i++)
_vp_psy_clear(b->psy+i);
_ogg_free(b->psy);
}
......@@ -352,8 +355,9 @@ void vorbis_dsp_clear(vorbis_dsp_state *v){
}
if(v->pcm){
for(i=0;i<vi->channels;i++)
if(v->pcm[i])_ogg_free(v->pcm[i]);
if(vi)
for(i=0;i<vi->channels;i++)
if(v->pcm[i])_ogg_free(v->pcm[i]);
_ogg_free(v->pcm);
if(v->pcmret)_ogg_free(v->pcmret);
}
......
......@@ -135,8 +135,8 @@ void vorbis_comment_clear(vorbis_comment *vc){
if(vc->user_comments)_ogg_free(vc->user_comments);
if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
if(vc->vendor)_ogg_free(vc->vendor);
memset(vc,0,sizeof(*vc));
}
memset(vc,0,sizeof(*vc));
}
/* blocksize 0 is guaranteed to be short, 1 is guaranteed to be long.
......@@ -600,12 +600,14 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
memset(op_comm,0,sizeof(*op_comm));
memset(op_code,0,sizeof(*op_code));
if(b->header)_ogg_free(b->header);
if(b->header1)_ogg_free(b->header1);
if(b->header2)_ogg_free(b->header2);
b->header=NULL;
b->header1=NULL;
b->header2=NULL;
if(b){
if(b->header)_ogg_free(b->header);
if(b->header1)_ogg_free(b->header1);
if(b->header2)_ogg_free(b->header2);
b->header=NULL;
b->header1=NULL;
b->header2=NULL;
}
return(ret);
}
......
......@@ -11,7 +11,7 @@
********************************************************************
function: psychoacoustics not including preecho
last mod: $Id: psy.c,v 1.81 2002/10/21 07:00:11 xiphmont Exp $
last mod: $Id$
********************************************************************/
......@@ -553,7 +553,10 @@ static void bark_noise_hybridmp(int n,const long *b,
int i;
int lo, hi;
float R, A, B, D;
float R=0.f;
float A=0.f;
float B=0.f;
float D=1.f;
float w, x, y;
tN = tX = tXX = tY = tXY = 0.f;
......
......@@ -986,8 +986,8 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
ogg_packet op;
int lastblock=0;
int accblock=0;
int thisblock;
int eosflag;
int thisblock=0;
int eosflag=0;
ogg_stream_init(&work_os,vf->current_serialno); /* get the memory ready */
ogg_stream_reset(&work_os); /* eliminate the spurious OV_HOLE
......@@ -1009,7 +1009,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
}else{
if(eosflag)
ogg_stream_packetout(&vf->os,NULL);
ogg_stream_packetout(&vf->os,NULL);
else
if(lastblock)accblock+=(lastblock+thisblock)>>2;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment