OSDN Git Service

st/wgl: Return NULL for NULL HDCs in wglGetExtensionsStringARB.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 23 Dec 2011 02:57:29 +0000 (02:57 +0000)
committerBrian Paul <brianp@vmware.com>
Wed, 11 Jan 2012 19:51:40 +0000 (12:51 -0700)
WGL_ARB_extensions_string states that wglGetExtensionsStringARB should
return NULL for invalid HDCs.  And some applications rely on it.

Reviewed-By: "Keith Whitwell" <keithw@vmware.com>
src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c

index ecb326f..7cad49c 100644 (file)
@@ -47,7 +47,9 @@ WINGDIAPI const char * APIENTRY
 wglGetExtensionsStringARB(
    HDC hdc )
 {
-   (void) hdc;
+   if (!hdc) {
+      return NULL;
+   }
 
    return stw_extension_string;
 }