mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 15:10:10 +01:00
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:
parent
7d2fa8dc10
commit
7753f040fa
1 changed files with 6 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue