sftools icon indicating copy to clipboard operation
sftools copied to clipboard

sftools build from master hangs when converting KOR soundfont

Open ycollet opened this issue 5 years ago • 0 comments

I buillt sftools on Fedora 32 with gcc-10.2.1. When I convert the KOR soundfont (https://www.vogons.org/viewtopic.php?t=57273 - GM Complete, the link to the soundfont: https://downloads.kor.ninja/Music/korfontproject/?dir=complete) sftools hangs. The command line:

sf3convert -z KOR\ Soundfont\ -\ GM\ Complete\ 5.0.sf2 KOR\ Soundfont\ -\ GM\ Complete\ 5.0.sf3

The gdb stack trace:

#0  SoundFont::writeCompressedSample (this=0x7fffffffd790, s=0x79b7d0) at /home/collette/repositories/sftools/sfont.cpp:1187
#1  0x000000000040bd7a in SoundFont::writeSmpl (this=0x7fffffffd790) at /home/collette/repositories/sftools/sfont.cpp:896
#2  0x000000000040c04b in SoundFont::write (this=0x7fffffffd790, f=<optimized out>, oggQuality=<optimized out>, oggAmp=<optimized out>, oggSerial=<optimized out>)
    at /home/collette/repositories/sftools/sfont.cpp:782
#3  0x0000000000406d25 in main (argc=<optimized out>, argv=0x7fffffffd978) at /home/collette/repositories/sftools/sfconvert.cpp:149
(gdb) list
1182                return 0;
1183                }
1184          f.seek(samplePos + s->start * sizeof(short));
1185          int samples = s->end - s->start;
1186          short ibuffer[samples];
1187          f.read((char*)ibuffer, samples * sizeof(short));
1188          f.close();
1189
1190          ogg_stream_state os;
1191          ogg_page         og;
(gdb) print samples
$1 = 4949096
(gdb) print ibuffer
value requires 9898192 bytes, which is more than max-value-size

ycollet avatar Nov 01 '20 12:11 ycollet