fix bug in file closing logic in _finish()

This commit is contained in:
Josh Coalson
2006-09-16 00:08:45 +00:00
parent da6c00efc1
commit 180e0cac3a
2 changed files with 6 additions and 4 deletions

View File

@@ -581,8 +581,9 @@ FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder)
decoder->private_->output_capacity = 0;
decoder->private_->output_channels = 0;
if(0 != decoder->private_->file && decoder->private_->file != stdin) {
fclose(decoder->private_->file);
if(0 != decoder->private_->file) {
if(decoder->private_->file != stdin)
fclose(decoder->private_->file);
decoder->private_->file = 0;
}