mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
sndio: Remove variable-length array usage
This commit is contained in:
parent
a599dd50f6
commit
43ae532d2a
@ -97,7 +97,7 @@ static void *sndio_thread(void *attr)
|
||||
struct sndio_thr_data *thrdata = attr;
|
||||
size_t msgread = 0; // msg bytes read from socket
|
||||
size_t nsiofds = sio_nfds(thrdata->hdl);
|
||||
struct pollfd pfd[1 + nsiofds];
|
||||
struct pollfd *pfd = bzalloc(sizeof(struct pollfd) * (1 + nsiofds));
|
||||
struct sio_par par;
|
||||
uint64_t ts;
|
||||
ssize_t nread;
|
||||
@ -114,7 +114,6 @@ static void *sndio_thread(void *attr)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
memset(pfd, 0, sizeof(pfd));
|
||||
pfd[0].fd = thrdata->sock;
|
||||
|
||||
for (;;) {
|
||||
@ -237,6 +236,7 @@ finish:
|
||||
close(thrdata->sock);
|
||||
bfree(buf);
|
||||
bfree(thrdata);
|
||||
bfree(pfd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user