summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2011-10-28 09:52:34 -0500
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-01-07 22:50:09 +0000
commit3c501691a0a9fa17da4e2cc84f55010ef2a4790d (patch)
tree16f0fc61af91f6304c24d67e6fcacab7284eaa47
parenta492c02649de4c60ac21a7fcb6b7c730b558dca6 (diff)
hw/xwin: Fix possible null ptr deref in winActivateAppPrimaryDD()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--hw/xwin/winpfbdd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index a3990208d..1a5a0e7aa 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -461,12 +461,12 @@ static Bool
winActivateAppPrimaryDD (ScreenPtr pScreen)
{
winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
RECT rcSrc, rcClient;
HRESULT ddrval = DD_OK;
/* Check for errors */
if (pScreenPriv == NULL
+ || pScreenPriv->pScreenInfo == NULL
|| pScreenPriv->pddsPrimary == NULL
|| pScreenPriv->pddsOffscreen == NULL)
return FALSE;
@@ -500,8 +500,8 @@ winActivateAppPrimaryDD (ScreenPtr pScreen)
/* Setup a source rectangle */
rcSrc.left = 0;
rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
+ rcSrc.right = pScreenPriv->pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenPriv->pScreenInfo->dwHeight;
ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
&rcClient,