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:
parent
751d936588
commit
a82177e703
1 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue