Added a nullpointer check to a DDraw call, gets rid of one FIXME. (by Asdow)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8884 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-08-15 12:40:37 +00:00
parent c7d1acff01
commit 5eaec6881e
@@ -487,7 +487,7 @@ HRESULT BltDDSurfaceUsingSoftware( LPDIRECTDRAWSURFACE2 pDestSurface, LPRECT pDe
return( DD_OK );
}
else if ( uiFlags == DDBLT_WAIT )
else if ( (pSrcRect != nullptr) && (uiFlags == DDBLT_WAIT) )
{
// Lock surfaces
DDLockSurface( (LPDIRECTDRAWSURFACE2)pSrcSurface, NULL, &SurfaceDescription, 0, NULL);
@@ -501,12 +501,12 @@ HRESULT BltDDSurfaceUsingSoftware( LPDIRECTDRAWSURFACE2 pDestSurface, LPRECT pDe
( pSrcRect->right - pSrcRect->left ),
( pSrcRect->bottom - pSrcRect->top ) );
}
else if ( uiFlags & DDBLT_KEYSRC )
else if ((pSrcSurface != nullptr) && (pSrcRect != nullptr) && (uiFlags & DDBLT_KEYSRC ))
{
// Get 16 bpp color key.....
ReturnCode = IDirectDrawSurface2_GetColorKey( pSrcSurface, DDCKEY_SRCBLT, &ColorKey); // FIXME: pSrcSurface might be NULL
ReturnCode = IDirectDrawSurface2_GetColorKey( pSrcSurface, DDCKEY_SRCBLT, &ColorKey);
if (ReturnCode == DD_OK)
if (ReturnCode == DD_OK)
{
us16BPPColorKey = (UINT16)ColorKey.dwColorSpaceLowValue;