Skip to content

Commit

Permalink
linux-pipewire: Avoid trying to allocate 0 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
tytan652 committed Oct 5, 2024
1 parent e6d9f73 commit 164041b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/linux-pipewire/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ static bool build_format_params(obs_pipewire_stream *obs_pw_stream, struct spa_p
uint32_t params_count = 0;

const struct spa_pod **params;

if (!obs_pw_stream->format_info.num) {
blog(LOG_ERROR, "[pipewire] No format found while building param pointers");
return false;
}

params = bzalloc(2 * obs_pw_stream->format_info.num * sizeof(struct spa_pod *));

if (!params) {
Expand Down

0 comments on commit 164041b

Please sign in to comment.