diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2017-07-26 00:19:35 +1000 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2017-07-26 00:20:11 +1000 |
commit | 7097b6f81c76990952d65a6c5bea71b2f8856043 (patch) | |
tree | a1243c954e83fe257bc8d0cc71dab5b2e8fec940 | |
parent | f2809e19f017fb60af7c4a187f41a190d1bcd21d (diff) | |
download | mpv-7097b6f81c76990952d65a6c5bea71b2f8856043.tar.bz2 mpv-7097b6f81c76990952d65a6c5bea71b2f8856043.tar.xz |
subprocess-win: remove VLA usage
This only ever waits on four handles at most anyway.
-rw-r--r-- | osdep/subprocess-win.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/osdep/subprocess-win.c b/osdep/subprocess-win.c index 3ac0c397aa..b94be1a5ef 100644 --- a/osdep/subprocess-win.c +++ b/osdep/subprocess-win.c @@ -173,8 +173,10 @@ error: static int sparse_wait(HANDLE *handles, unsigned num_handles) { unsigned w_num_handles = 0; - HANDLE w_handles[num_handles]; - int map[num_handles]; + HANDLE w_handles[10]; + int map[10]; + if (num_handles > MP_ARRAY_SIZE(w_handles)) + return -1; for (unsigned i = 0; i < num_handles; i++) { if (!handles[i]) |