ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
667 stars 151 forks source link

Fix Config[1] out of bounds in gl4es_glXCreatePbuffer #431

Closed khanhduytran0 closed 1 year ago

khanhduytran0 commented 1 year ago

Shoutout to the compiler for finding it:

gl4es/src/glx/glx.c:2514:56: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
    return addPBuffer(Surface, Width, Height, Context, Config[1]);
                                                       ^      ~
gl4es/src/glx/glx.c:2470:5: note: array 'Config' declared here
    EGLConfig Config[1];
    ^
ptitSeb commented 1 year ago

Ooooh, indeed.