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>
* 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");