We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3698 - EGL and GL extension parsing has issues
Summary: EGL and GL extension parsing has issues
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 13:31 UTC by Simon Hug
Modified: 2017-08-03 22:31 UTC (History)
0 users

See Also:


Attachments
Patch that fixes extension parsing issues and adds EGL client extension querying. (5.44 KB, patch)
2017-07-07 13:31 UTC, Simon Hug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hug 2017-07-07 13:31:14 UTC
Created attachment 2789 [details]
Patch that fixes extension parsing issues and adds EGL client extension querying.

SDL_EGL_HasExtension is unable to detect the last extension in the string if it is directly followed by the terminating zero.

SDL_GL_ExtensionSupported has an out-of-bounds guard when checking for the space character but uses the wrong pointer in the comparison. This may cause it to incorrectly report an extension as present. Example: GL_EXT_moo is matched in the second half of GL_EXT_mooGL_EXT_moo.

The attached patch fixes these issues and also adds querying of client extension with EGL_EXT_client_extensions and EGL 1.5. This will probably be used for the KMSDRM driver proposed in bug 3690.
Comment 1 Simon Hug 2017-07-07 13:33:51 UTC
Oh, I forgot. In the patch, I commented out some error messages. Since the SDL_EGL_HasExtension function is an internal one, what would be the proper way to signal an error there? Asserts? Could you give me an example how that could look?
Comment 2 Simon Hug 2017-08-03 22:31:02 UTC
This is now resolved. Fix was in the kmsdrm video driver patch.