1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibGL: Support missing context in glGetError and glGetIntegerv

In its current state, ScummVM seems to invoke these methods just after
destroying the current GL context. According to the OpenGL spec:

    "Issuing GL commands when the program does not have a current
     context results in undefined behavior, up to and including program
     termination."

Our old behavior was to deref a `nullptr`, which isn't that great. For
now, protect these two methods. If other ports seem to misbehave as
well, we can always expand the check to other methods.
This commit is contained in:
Jelle Raaijmakers 2021-12-01 23:10:12 +01:00 committed by Andreas Kling
parent a06b69c5b5
commit b79642ef74
3 changed files with 13 additions and 0 deletions

View file

@ -5,6 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "GLContext.h"
#include "SoftwareGLContext.h"
#include <LibGfx/Bitmap.h>