winex11.drv/opengl.c: Unhandled null pointer

Dmitry Timoshkov dmitry at codeweavers.com
Tue Mar 22 03:38:23 CDT 2011


Joshua Beck <jxb091000 at utdallas.edu> wrote:

>     350: str = (const char *) pglGetString(GL_EXTENSIONS);
>     351: WineGLInfo.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str)+1);
>        
> 
>  From this it's obvious that pglGetString is returning a null pointer.

What OpenGL driver are you using? glGetString(GL_EXTENSIONS) returning NULL
might be a driver bug.

> It would be better to do something like this instead:
> 
>     str = (const char *) pglGetString(GL_EXTENSIONS);
>     if(str == 0)
>     {
>          ERR( "Couldn't find GL_EXTENSIONS string, disabling OpenGL.\n" );
>          goto done;
>     }
>     WineGLInfo.glExtensions = HeapAlloc(GetProcessHeap(), 0, strlen(str)+1);
>        
> 
> What do you think?

WineGLInfo.glExtensions is used in other places in the code, it must be
initialized.

-- 
Dmitry.



More information about the wine-devel mailing list