mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
fix detection of reallocarray
Fix detection of reallocarray (e.g. on glibc) raised since commit
0708a39b43
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
parent
63d2102594
commit
85ca67b927
13 changed files with 35 additions and 20 deletions
|
|
@ -50,6 +50,7 @@
|
|||
#include <spa/utils/string.h>
|
||||
#include <spa/utils/json.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "codec-loader.h"
|
||||
#include "player.h"
|
||||
#include "defs.h"
|
||||
|
|
@ -1579,7 +1580,11 @@ const struct a2dp_codec **spa_bt_device_get_supported_a2dp_codecs(struct spa_bt_
|
|||
if (j >= size) {
|
||||
const struct a2dp_codec **p;
|
||||
size = size * 2;
|
||||
#ifdef HAVE_REALLOCARRRAY
|
||||
p = reallocarray(supported_codecs, size, sizeof(const struct a2dp_codec *));
|
||||
#else
|
||||
p = realloc(supported_codecs, size * sizeof(const struct a2dp_codec *));
|
||||
#endif
|
||||
if (p == NULL) {
|
||||
free(supported_codecs);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue