bonefish+mmu_man: fix cbuf_user_memcpy_from_chain() returning an error when the source buffer was NULL despite being asked for 0 bytes, while the counterpart was actually not creating a buffer for 0 bytes to send... Also don't bother calling it from receive_data() in that case anyway.

This fixes a deadlock in SoundPlay that made it freeze when trying to play the 2nd sound.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28179 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2008-10-16 19:48:28 +00:00
parent 20ca748ade
commit 1e2bc11e99
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -743,7 +743,7 @@ receive_data_etc(thread_id *_sender, void *buffer, size_t bufferSize,
return status;
}
if (buffer != NULL && bufferSize != 0) {
if (buffer != NULL && bufferSize != 0 && thread->msg.buffer != NULL) {
size = min_c(bufferSize, thread->msg.size);
status = cbuf_user_memcpy_from_chain(buffer, thread->msg.buffer,
0, size);
+2
View File
@@ -529,6 +529,8 @@ cbuf_user_memcpy_from_chain(void *_dest, cbuf *chain, size_t offset, size_t leng
int bufferOffset;
int err;
if (length == 0)
return B_OK;
if (chain == NULL)
return B_BAD_VALUE;