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 Sep 13, 2024
1 parent 7a35d7c commit dc49a22
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/linux-pipewire/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ static bool build_format_params(obs_pipewire_stream *obs_pw_stream,
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 *));

Expand Down

0 comments on commit dc49a22

Please sign in to comment.