Fix null pointer crash in preferences

When turning off "use JackAudio" in preferences, l and r get set to null.
In this case, skip the section that uses them.
This commit is contained in:
Tony Mountifield 2013-02-09 13:00:03 +00:00
parent 751d936588
commit a82177e703

View file

@ -363,12 +363,14 @@ int JackAudio::processAudio(jack_nframes_t frames, void* p)
}
}
}
float buffer[frames * 2];
audio->seq->process((unsigned)frames, buffer);
float* sp = buffer;
for (unsigned i = 0; i < frames; ++i) {
*l++ = *sp++;
*r++ = *sp++;
if (l && r) {
float buffer[frames * 2];
audio->seq->process((unsigned)frames, buffer);
float* sp = buffer;
for (unsigned i = 0; i < frames; ++i) {
*l++ = *sp++;
*r++ = *sp++;
}
}
return 0;
}