diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index 197c6df31..aa540f93f 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -517,6 +517,12 @@ static BOOL update_check_flush(rdpContext* context, int size) s = update->us; + if (!update->us) + { + update->BeginPaint(context); + return FALSE; + } + if (Stream_GetPosition(s) + size + 256 >= settings->MultifragMaxRequestSize) { update_flush(context); diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index 8060aa8ed..d687e7c55 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -62,13 +62,16 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) thread = (WINPR_THREAD*) Object; - status = pthread_join(thread->thread, &thread_status); + if (thread->started) + { + status = pthread_join(thread->thread, &thread_status); - if (status != 0) - fprintf(stderr, "WaitForSingleObject: pthread_join failure: %d\n", status); + if (status != 0) + fprintf(stderr, "WaitForSingleObject: pthread_join failure: %d\n", status); - if (thread_status) - thread->dwExitCode = ((DWORD) (size_t) thread_status); + if (thread_status) + thread->dwExitCode = ((DWORD) (size_t) thread_status); + } } else if (Type == HANDLE_TYPE_MUTEX) {