Browse Source

Stop leaking file streams in libespeak-ng's LoadSpectSeq function.

master
Michael Curran 9 years ago
parent
commit
9d187f0588
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      src/libespeak-ng/spect.c

+ 7
- 1
src/libespeak-ng/spect.c View File

else else
{ {
fprintf(stderr, "Unsupported spectral file format.\n"); fprintf(stderr, "Unsupported spectral file format.\n");
fclose(stream);
return(1); return(1);
} }


fread(&spect->max_y,sizeof(short),1,stream); fread(&spect->max_y,sizeof(short),1,stream);
fread(&temp,sizeof(short),1,stream); // unused fread(&temp,sizeof(short),1,stream); // unused


if(n==0) return(0);
if(n==0)
{
fclose(stream);
return(0);
}


if(spect->frames != NULL) if(spect->frames != NULL)
{ {
if(spect->frames[ix]->keyframe) if(spect->frames[ix]->keyframe)
spect->frames[ix]->length_adjust = spect->frames[ix]->length - GetFrameLength(spect,ix); spect->frames[ix]->length_adjust = spect->frames[ix]->length - GetFrameLength(spect,ix);
} }
fclose(stream);
return(0); return(0);
} }

Loading…
Cancel
Save