diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index 7ef0b850b..b0ae53490 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -89,7 +89,11 @@ BOOL wf_peer_post_connect(freerdp_peer* client) ReleaseDC(NULL, hdc); */ - if (get_screen_info(wfi->screenID, NULL, &wfi->width, &wfi->height, &wfi->bitsPerPixel) == 0) + if ( + (get_screen_info(wfi->screenID, NULL, &wfi->width, &wfi->height, &wfi->bitsPerPixel) == 0) || + (wfi->width == 0) || + (wfi->height == 0) || + (wfi->bitsPerPixel == 0) ) { _tprintf(_T("postconnect: error getting screen info for screen %d\n"), wfi->screenID); return FALSE;