Skip to content

Commit f666a90

Browse files
committed
Guard against out of bound read
1 parent 0927438 commit f666a90

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/soundio/sounddevicenetwork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ void SoundDeviceNetwork::workerWriteProcess(NetworkOutputStreamWorkerPtr pWorker
326326
}
327327
} else if (writeExpected - readAvailable > outChunkSize / 2) {
328328
// try to keep PAs buffer filled up to 0.5 chunks
329-
if (pWorker->outputDrift()) {
329+
if (pWorker->outputDrift() && (size1 / m_numOutputChannels) > 0) {
330330
// duplicate one frame
331331
// kLogger.debug() << "workerWriteProcess() duplicate one frame"
332332
// << (float)writeExpected / outChunkSize

0 commit comments

Comments
 (0)