Don't crash if pDDSD is NULL on DirectDrawSurface::Lock.
This commit is contained in:
parent
12a749984c
commit
9e18b7efa9
|
@ -640,14 +640,17 @@ void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd)
|
|||
};
|
||||
#undef STRUCT
|
||||
|
||||
if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
|
||||
if (NULL == lpddsd) {
|
||||
DPRINTF("(null)\n");
|
||||
} else {
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
|
||||
if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
|
||||
} else {
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
|
||||
}
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
|
||||
sizeof(members)/sizeof(members[0]));
|
||||
}
|
||||
|
||||
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
|
||||
sizeof(members)/sizeof(members[0]));
|
||||
}
|
||||
|
||||
void DDRAW_dump_cooperativelevel(DWORD cooplevel)
|
||||
|
|
|
@ -1093,6 +1093,12 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
WARN(" - unsupported locking flag : "); DDRAW_dump_lockflag(flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY));
|
||||
}
|
||||
}
|
||||
if (NULL != h) {
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
if (NULL == pDDSD) {
|
||||
return DDERR_INVALIDPARAMS; /** really ? */
|
||||
}
|
||||
|
||||
/* If the surface is already locked, return busy */
|
||||
if (This->locked) {
|
||||
|
|
Loading…
Reference in New Issue