From 71d73de3596dd1ca0bbf5217573271cdc80e52bb Mon Sep 17 00:00:00 2001 From: nitsuja Date: Tue, 8 Dec 2009 17:15:44 +0000 Subject: [PATCH] fix possible crash on minimizing app --- desmume/src/windows/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 56ec113c2..8f3917a72 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -479,6 +479,13 @@ void UnscaleScreenCoords(s32& x, s32& y) int defheight = video.height; int winwidth = (r.right-r.left), winheight = (r.bottom-r.top); + if(winwidth == 0 || winheight == 0) + { + x = 0; + y = 0; + return; + } + if (video.layout == 0) { defheight += video.scaledscreengap();