Commit 180e0cac authored by Josh Coalson's avatar Josh Coalson

fix bug in file closing logic in _finish()

parent da6c00ef
......@@ -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;
}
......
......@@ -354,8 +354,9 @@ OggFLAC_API FLAC__bool OggFLAC__stream_decoder_finish(OggFLAC__StreamDecoder *de
OggFLAC__ogg_decoder_aspect_finish(&decoder->protected_->ogg_decoder_aspect);
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;
}
......
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