Merge pull request #322 from jprjr/vgmstream-cli-segfault

vgmstream-cli: prevent segfault when printing metadata
This commit is contained in:
Christopher Snowhill 2018-11-29 17:09:40 -08:00 committed by GitHub
commit d1a16e15b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -433,8 +433,11 @@ int main(int argc, char ** argv) {
/* prints done */ /* prints done */
if (cfg.print_metaonly) { if (cfg.print_metaonly) {
if (!cfg.play_sdtout) if (!cfg.play_sdtout) {
fclose(outfile); if(outfile != NULL) {
fclose(outfile);
}
}
close_vgmstream(vgmstream); close_vgmstream(vgmstream);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }