Make sure vsync arrays are big enough

Fix array boundary overrun

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-17 00:50:57 +00:00
parent eabe2b5bb8
commit 7901b86024
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 3 additions and 3 deletions

View File

@ -160,7 +160,7 @@ vsync_opengl_mswc_init(session_t *ps) {
return vsync_opengl_swc_init(ps);
}
bool (*const VSYNC_FUNCS_INIT[])(session_t *ps) = {
bool (*const VSYNC_FUNCS_INIT[NUM_VSYNC])(session_t *ps) = {
[VSYNC_DRM ] = vsync_drm_init,
[VSYNC_OPENGL ] = vsync_opengl_init,
[VSYNC_OPENGL_OML ] = vsync_opengl_oml_init,
@ -230,7 +230,7 @@ vsync_opengl_oml_wait(session_t *ps) {
#endif
/// Function pointers to wait for VSync.
int (*const VSYNC_FUNCS_WAIT[])(session_t *ps) = {
int (*const VSYNC_FUNCS_WAIT[NUM_VSYNC])(session_t *ps) = {
#ifdef CONFIG_VSYNC_DRM
[VSYNC_DRM ] = vsync_drm_wait,
#endif
@ -249,7 +249,7 @@ vsync_opengl_swc_deinit(session_t *ps) {
/// Function pointers to deinitialize VSync.
void (*const VSYNC_FUNCS_DEINIT[])(session_t *ps) = {
void (*const VSYNC_FUNCS_DEINIT[NUM_VSYNC])(session_t *ps) = {
#ifdef CONFIG_OPENGL
[VSYNC_OPENGL_SWC ] = vsync_opengl_swc_deinit,
[VSYNC_OPENGL_MSWC ] = vsync_opengl_swc_deinit,