From 97874749dae65b61249da79a80f562234d86c8f6 Mon Sep 17 00:00:00 2001 From: bnnm Date: Wed, 18 Apr 2018 20:41:11 +0200 Subject: [PATCH] Fix possible segfault --- src/meta/msb_msh.c | 5 ++--- src/meta/smc_smh.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/meta/msb_msh.c b/src/meta/msb_msh.c index a5abc447..0333716f 100644 --- a/src/meta/msb_msh.c +++ b/src/meta/msb_msh.c @@ -72,12 +72,11 @@ VGMSTREAM * init_vgmstream_msb_msh(STREAMFILE *streamFile) { vgmstream->interleave_block_size = 0x10; - close_streamfile(streamHeader); - if (!vgmstream_open_stream(vgmstream,streamFile,start_offset)) goto fail; - return vgmstream; + close_streamfile(streamHeader); + return vgmstream; fail: close_streamfile(streamHeader); diff --git a/src/meta/smc_smh.c b/src/meta/smc_smh.c index 295189fd..9f65e45f 100644 --- a/src/meta/smc_smh.c +++ b/src/meta/smc_smh.c @@ -33,7 +33,6 @@ VGMSTREAM * init_vgmstream_smc_smh(STREAMFILE *streamFile) { sample_rate = read_32bitLE(header_offset+0x08, streamHeader); /* 0x0c(2): always 0x10, frame size? */ channel_count = read_16bitLE(header_offset+0x0e, streamHeader); - loop_flag = 0; @@ -53,10 +52,10 @@ VGMSTREAM * init_vgmstream_smc_smh(STREAMFILE *streamFile) { vgmstream->interleave_block_size = read_32bitLE(0x04, streamHeader); - close_streamfile(streamHeader); - if (!vgmstream_open_stream(vgmstream,streamFile,start_offset)) goto fail; + + close_streamfile(streamHeader); return vgmstream; fail: