From 7f2dcf3257323bc8e79c7b6d4fdf3eabbdbf8be8 Mon Sep 17 00:00:00 2001 From: Corey C Date: Tue, 23 Oct 2012 20:43:39 -0400 Subject: [PATCH] wfreerdp-server: fixed crash with selected zero resolution displays --- server/Windows/wf_peer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;