mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
vulkan: Return early in use_buffers
This fixes accesing a buffer in [1] when none is provided.
[1] 3f80bc2e70
This commit is contained in:
parent
324ec9df15
commit
2b2e53ad90
1 changed files with 3 additions and 1 deletions
|
|
@ -524,9 +524,11 @@ int spa_vulkan_compute_use_buffers(struct vulkan_compute_state *s, struct vulkan
|
||||||
clear_buffers(s, p);
|
clear_buffers(s, p);
|
||||||
p->format = SPA_VIDEO_FORMAT_UNKNOWN;
|
p->format = SPA_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
|
if (n_buffers == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
bool alloc = flags & SPA_NODE_BUFFERS_FLAG_ALLOC;
|
bool alloc = flags & SPA_NODE_BUFFERS_FLAG_ALLOC;
|
||||||
int ret;
|
int ret;
|
||||||
p->n_buffers = 0;
|
|
||||||
for (uint32_t i = 0; i < n_buffers; i++) {
|
for (uint32_t i = 0; i < n_buffers; i++) {
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
if (SPA_FLAG_IS_SET(buffers[i]->datas[0].type, 1<<SPA_DATA_DmaBuf)) {
|
if (SPA_FLAG_IS_SET(buffers[i]->datas[0].type, 1<<SPA_DATA_DmaBuf)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue