Rémi Bernon (@rbernon) commented about dlls/opengl32/wgl.c:
.nAttributes = nAttributes,
.piAttributes = piAttributes,
.piValues = piValues
};
NTSTATUS status;
if ((status = UNIX_CALL( wglGetPixelFormatAttribivARB, &args )))
WARN( "wglGetPixelFormatAttribivARB returned %#lx\n", status );
return args.ret;
- }
- if (iPixelFormat > 0 && iPixelFormat - 1 < num_formats)
format = &formats[iPixelFormat - 1];
- else
format = NULL;
What about splitting the error path?
```suggestion:-8+0 /* FIXME: are these even supposed to be checked? call SetLastError? */ if (!count) return GL_TRUE; if (!attributes || !values) return GL_FALSE; /* should index be checked after or before? */ if (count == 1 && attributes[0] == WGL_NUMBER_PIXEL_FORMATS_ARB) { values[0] = nb_formats; return GL_TRUE; } if (index <= 0 || index > num_formats) { SetLastError( ERROR_INVALID_PIXEL_FORMAT ); return GL_FALSE; }
format = &formats[index - 1]; ```