Fix FSB5 .bank segfault when failing to open encrypted files

This commit is contained in:
bnnm 2020-11-01 15:27:48 +01:00
parent d57fe63681
commit 7497b6370e

View File

@ -121,6 +121,8 @@ VGMSTREAM* init_vgmstream_fsb5_fev_bank(STREAMFILE* sf) {
}
}
//;VGM_LOG("FSB5 FEV: offset=%lx, size=%x\n", subfile_offset,subfile_size);
temp_sf = setup_subfile_streamfile(sf, subfile_offset,subfile_size, "fsb");
if (!temp_sf) goto fail;
@ -129,12 +131,12 @@ VGMSTREAM* init_vgmstream_fsb5_fev_bank(STREAMFILE* sf) {
vgmstream = (read_u32be(0x00, temp_sf) == 0x46534235) ? /* "FSB5" (better flag?)*/
init_vgmstream_fsb5(temp_sf) :
init_vgmstream_fsb_encrypted(temp_sf);
close_streamfile(temp_sf);
if (!vgmstream) goto fail;
vgmstream->stream_index = sf->stream_index; //target_subsong; /* 0-index matters */
vgmstream->num_streams = total_subsongs;
close_streamfile(temp_sf);
return vgmstream;
fail: