mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-18 07:00:06 -05:00
filter, stream: Fix error check for DMA-BUF buffers
When a buffer is of type SPA_DATA_DmaBuf, the 'data' field will be NULL - we instead have to check if the file descriptor is valid. The current code, however, always checks if the data is NULL, which gives a false positive for DMA-BUF buffers, signaling an error when there is none. Fix that by also checking if the buffer type is MemPtr together with the NULL check of the 'data' field.
This commit is contained in:
parent
4b076549f7
commit
56e2d6a3da
2 changed files with 2 additions and 2 deletions
|
|
@ -684,7 +684,7 @@ static int impl_port_use_buffers(void *object,
|
|||
return res;
|
||||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_MAPPED);
|
||||
}
|
||||
else if (d->data == NULL) {
|
||||
else if (d->type == SPA_DATA_MemPtr && d->data == NULL) {
|
||||
pw_log_error(NAME" %p: invalid buffer mem", filter);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ static int impl_port_use_buffers(void *object,
|
|||
return res;
|
||||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_MAPPED);
|
||||
}
|
||||
else if (d->data == NULL) {
|
||||
else if (d->type == SPA_DATA_MemPtr && d->data == NULL) {
|
||||
pw_log_error(NAME" %p: invalid buffer mem", stream);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue