From 7901b8602488230911e1f5449a46b893a29c4f74 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 17 Dec 2018 00:50:57 +0000 Subject: [PATCH] Make sure vsync arrays are big enough Fix array boundary overrun Signed-off-by: Yuxuan Shui --- src/vsync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vsync.c b/src/vsync.c index 17290eb..909ad2d 100644 --- a/src/vsync.c +++ b/src/vsync.c @@ -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,