stw/wgl: add null context check in wglBindTexImageARB()
To avoid dereferencing a null pointer in case wglMakeCurrent() wasn't called. Found while debugging SWKOTOR game. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
This commit is contained in:
@@ -129,6 +129,12 @@ wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer)
|
||||
* we do here.
|
||||
*/
|
||||
|
||||
if (!curctx) {
|
||||
debug_printf("No rendering context in wglBindTexImageARB()\n");
|
||||
SetLastError(ERROR_INVALID_OPERATION);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
|
||||
if (!fb) {
|
||||
debug_printf("Invalid pbuffer handle in wglBindTexImageARB()\n");
|
||||
|
||||
Reference in New Issue
Block a user