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, ...@@ -1445,9 +1445,11 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
} else { } else {
int32_t bytesToCopy = __MIN(bytesRequested, availableBytes); int32_t bytesToCopy = __MIN(bytesRequested, availableBytes);
memcpy(targetBuffer, buffer, bytesToCopy); if (likely(bytesToCopy > 0)) {
TPCircularBufferConsume(&p_sys->circular_buffer, bytesToCopy); memcpy(targetBuffer, buffer, bytesToCopy);
ioData->mBuffers[0].mDataByteSize = bytesToCopy; TPCircularBufferConsume(&p_sys->circular_buffer, bytesToCopy);
ioData->mBuffers[0].mDataByteSize = bytesToCopy;
}
} }
vlc_cond_signal(&p_sys->cond); 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