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:
Fabrice Fontaine 2022-05-27 15:00:17 +02:00 committed by Wim Taymans
parent 63d2102594
commit 85ca67b927
13 changed files with 35 additions and 20 deletions

View file

@ -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;