Skip to content

Commit

Permalink
Close file when stream_encoder init fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed May 28, 2022
1 parent 9e14376 commit 9e42562
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libFLAC/stream_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,11 @@ FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder)
encoder->protected_->metadata = 0;
encoder->protected_->num_metadata_blocks = 0;
}
if(0 != encoder->private_->file) {
if(encoder->private_->file != stdout)
fclose(encoder->private_->file);
encoder->private_->file = 0;
}
return true;
}

Expand Down

0 comments on commit 9e42562

Please sign in to comment.