poll: don't call WSAWaitForMultipleEvents with no events

Fixes error caught by Microsoft Application Verifier.
This commit is contained in:
Thomas Kristensen 2011-03-25 15:56:07 +01:00 committed by Sebastian Dröge
parent e1ac508cab
commit d0d27e83fe

View file

@ -1375,8 +1375,13 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
t = 0;
}
wait_ret = WSAWaitForMultipleEvents (set->active_events->len,
(HANDLE *) set->active_events->data, FALSE, t, FALSE);
if (set->active_events->len != 0) {
wait_ret = WSAWaitForMultipleEvents (set->active_events->len,
(HANDLE *) set->active_events->data, FALSE, t, FALSE);
} else {
wait_ret = WSA_WAIT_FAILED;
WSASetLastError (WSA_INVALID_PARAMETER);
}
if (ignore_count == 0 && wait_ret == WSA_WAIT_TIMEOUT) {
res = 0;