Commit 4598d6ca authored by Felix Paul Kühne's avatar Felix Paul Kühne

auhal: add missing bounds checking (close #10110)

parent 061c07bd
......@@ -1445,9 +1445,11 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
} else {
int32_t bytesToCopy = __MIN(bytesRequested, availableBytes);
memcpy(targetBuffer, buffer, bytesToCopy);
TPCircularBufferConsume(&p_sys->circular_buffer, bytesToCopy);
ioData->mBuffers[0].mDataByteSize = bytesToCopy;
if (likely(bytesToCopy > 0)) {
memcpy(targetBuffer, buffer, bytesToCopy);
TPCircularBufferConsume(&p_sys->circular_buffer, bytesToCopy);
ioData->mBuffers[0].mDataByteSize = bytesToCopy;
}
}
vlc_cond_signal(&p_sys->cond);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment