Fix random init with .diva looping

This commit is contained in:
M&M 2020-04-15 15:10:50 -07:00
parent c3ab39f665
commit 969f19d937

View File

@ -7,7 +7,7 @@ VGMSTREAM * init_vgmstream_diva(STREAMFILE *streamFile) {
off_t start_offset;
int channel_count;
int loop_end;
int loop_flag = (loop_end != 0);
int loop_flag;
/* checks */
if (!check_extensions(streamFile, "diva"))
@ -20,6 +20,8 @@ VGMSTREAM * init_vgmstream_diva(STREAMFILE *streamFile) {
channel_count = read_8bit(0x1C, streamFile);
loop_end = read_32bitLE(0x18, streamFile);
loop_flag = (loop_end != 0);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count, loop_flag);
if (!vgmstream) goto fail;