Commit 65b3393d authored by Peter Urbanec's avatar Peter Urbanec Committed by Alexandre Julliard

wintab32: Check for NULL before using context.

parent 0eebcf57
......@@ -685,6 +685,12 @@ BOOL WINAPI WTOverlap(HCTX hCtx, BOOL fToTop)
EnterCriticalSection(&csTablet);
context = TABLET_FindOpenContext(hCtx);
if (!context)
{
LeaveCriticalSection(&csTablet);
return FALSE;
}
/* if we want to send to top and it's not already there */
if (fToTop && context->context.lcStatus != CXS_ONTOP)
{
......@@ -777,6 +783,12 @@ BOOL WINAPI WTSetA(HCTX hCtx, LPLOGCONTEXTA lpLogCtx)
EnterCriticalSection(&csTablet);
context = TABLET_FindOpenContext(hCtx);
if (!context)
{
LeaveCriticalSection(&csTablet);
return FALSE;
}
LOGCONTEXTAtoW(lpLogCtx, &context->context);
LeaveCriticalSection(&csTablet);
......@@ -799,6 +811,12 @@ BOOL WINAPI WTSetW(HCTX hCtx, LPLOGCONTEXTW lpLogCtx)
EnterCriticalSection(&csTablet);
context = TABLET_FindOpenContext(hCtx);
if (!context)
{
LeaveCriticalSection(&csTablet);
return FALSE;
}
memmove(&context->context, lpLogCtx, sizeof(LOGCONTEXTW));
LeaveCriticalSection(&csTablet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment