summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/state_trackers/wgl/stw_ext_pbuffer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
index 085591a5560..7596cb6bd95 100644
--- a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
@@ -239,6 +239,11 @@ wglGetPbufferDCARB(HPBUFFERARB hPbuffer)
struct stw_framebuffer *fb;
HDC hDC;
+ if (!hPbuffer) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return NULL;
+ }
+
fb = (struct stw_framebuffer *)hPbuffer;
hDC = GetDC(fb->hWnd);
@@ -255,6 +260,11 @@ wglReleasePbufferDCARB(HPBUFFERARB hPbuffer,
{
struct stw_framebuffer *fb;
+ if (!hPbuffer) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return 0;
+ }
+
fb = (struct stw_framebuffer *)hPbuffer;
return ReleaseDC(fb->hWnd, hDC);
@@ -266,6 +276,11 @@ wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
{
struct stw_framebuffer *fb;
+ if (!hPbuffer) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
fb = (struct stw_framebuffer *)hPbuffer;
/* This will destroy all our data */
@@ -280,6 +295,11 @@ wglQueryPbufferARB(HPBUFFERARB hPbuffer,
{
struct stw_framebuffer *fb;
+ if (!hPbuffer) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
fb = (struct stw_framebuffer *)hPbuffer;
switch (iAttribute) {