mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
spa: audioconvert: fix allocation size calculation
Currently, the code allocates sizeof(header) * sizeof(item) * n_items bytes instead of the more appropriate sizeof(header) + sizeof(item) * n_items Fix that by simply changing the first multiplication to addition, and furthermore, use a flexible array member instead of a zero-sized array. Found by clang-tidy.
This commit is contained in:
parent
6515553b7d
commit
d2114c3f2e
2 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@
|
|||
struct peaks_data {
|
||||
uint32_t o_count;
|
||||
uint32_t i_count;
|
||||
float max_f[0];
|
||||
float max_f[];
|
||||
};
|
||||
|
||||
#if defined (HAVE_SSE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue