comparison audioio/AudioJACKTarget.cpp @ 416:7b2dd0d4c366

Correct some really stupid fixed-length string stuff, including a genuine stack overflow that causes a crash on OS/X for certain colour 3d plot data.
author Chris Cannam
date Mon, 29 Sep 2014 13:27:13 +0100
parents 49d5e885f58e
children 72c662fe7ea3
comparison
equal deleted inserted replaced
415:49d5e885f58e 416:7b2dd0d4c366
365 #ifdef DEBUG_AUDIO_JACK_TARGET 365 #ifdef DEBUG_AUDIO_JACK_TARGET
366 SVDEBUG << "AudioJACKTarget::sourceModelReplaced: have " << channels << " channels and " << physicalPortCount << " physical ports" << endl; 366 SVDEBUG << "AudioJACKTarget::sourceModelReplaced: have " << channels << " channels and " << physicalPortCount << " physical ports" << endl;
367 #endif 367 #endif
368 368
369 while ((int)m_outputs.size() < channels) { 369 while ((int)m_outputs.size() < channels) {
370 370
371 char name[20]; 371 const int namelen = 30;
372 char name[namelen];
372 jack_port_t *port; 373 jack_port_t *port;
373 374
374 sprintf(name, "out %d", int(m_outputs.size() + 1)); 375 snprintf(name, namelen, "out %d", int(m_outputs.size() + 1));
375 376
376 port = jack_port_register(m_client, 377 port = jack_port_register(m_client,
377 name, 378 name,
378 JACK_DEFAULT_AUDIO_TYPE, 379 JACK_DEFAULT_AUDIO_TYPE,
379 JackPortIsOutput, 380 JackPortIsOutput,