From e66f50fb76ec3c28811827a0a44cd2926e075f62 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 8 Feb 2013 00:33:10 +0000 Subject: [PATCH] Update DUMB to revision f5f34570905e87f1933a0220d71d0d48c05b9b49 - Added a workaround for bad sample offsets in STM files - Disabled inserting note cut commands in STM files, as there is no such command in the format SVN r4084 (trunk) --- dumb/src/it/readstm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dumb/src/it/readstm.c b/dumb/src/it/readstm.c index 1c9994e4ed..be1b157204 100644 --- a/dumb/src/it/readstm.c +++ b/dumb/src/it/readstm.c @@ -134,10 +134,6 @@ static int it_stm_read_pattern( IT_PATTERN *pattern, DUMBFILE *f, unsigned char entry->effectvalue = buffer[ pos + 3 ]; if ( entry->instrument && entry->instrument < 32 ) entry->mask |= IT_ENTRY_INSTRUMENT; - if ( note == 0xFC || note == 0xFE ) { - entry->mask |= IT_ENTRY_NOTE; - entry->note = IT_NOTE_CUT; - } if ( note < 251 ) { entry->mask |= IT_ENTRY_NOTE; entry->note = ( note >> 4 ) * 12 + ( note & 0x0F ); @@ -362,8 +358,15 @@ static DUMB_IT_SIGDATA *it_stm_load_sigdata(DUMBFILE *f, int * version) } } - dumbfile_skip( f, o - dumbfile_pos( f ) ); - if ( dumbfile_getnc( (char*)data_block, p - o, f ) != p - o ) { + q = o - dumbfile_pos( f ); + p -= o; + o = 0; + if ( q >= 0 ) dumbfile_skip( f, q ); + else { + o = -q; + memset ( data_block, 0, o ); + } + if ( dumbfile_getnc( (char*)data_block + o, p - o, f ) != p - o ) { free( data_block ); _dumb_it_unload_sigdata( sigdata ); return NULL;