winex11.drv/opengl.c: Unhandled null pointer

Dmitry Timoshkov dmitry at codeweavers.com
Tue Mar 22 04:10:34 CDT 2011


[Please do not omit wine-devel at winehq.org when replying]

Joshua Beck <jxb091000 at utdallas.edu> wrote:

> > What OpenGL driver are you using? glGetString(GL_EXTENSIONS) returning NULL
> > might be a driver bug.
> >    
> I'm using an nvidia binary driver (260.36.19 I think). Thing is I'm 
> running Debian amd64 and I compiled wine with -m32. I checked and there 
> are nvidia libraries in /usr/lib32. However I don't know if all of them 
> are in there or if they work correctly.

See http://wiki.winehq.org/3DDriverIssues how to diagnose GL driver problems.

> >> 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.
> >
> >    
> If str == 0 then the program is going to crash before anything else can 
> get to WineGLInfo.glExtensions. Better to say what the error is than to 
> crash with an "Unhandled page fault" error. If it's that important to 
> have WineGLInfo.glExtensions  initialized to something then initialize 
> it to an error code.

If pglGetString(GL_EXTENSIONS) returns NULL for whatever reason allocating
an 1 byte WineGLInfo.glExtensions buffer and setting it to 0 should work just
fine.

-- 
Dmitry.



More information about the wine-devel mailing list