summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorChibiDenDen <pdaniq@gmail.com>2023-02-20 11:35:28 +0200
committerGitHub <noreply@github.com>2023-02-20 11:35:28 +0200
commitaeab31b13a86f0108bbbee98af997bec21beb4e1 (patch)
treeb10d6371d02ba109dbb9a3f6387def5879aed33f /drivers/gles3
parent9f68d06ec2d8dbeb237c5aa5c6f9bbcbe26bde5d (diff)
Fix bufSize parameter for glGetSynciv
According to the docs: https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGetSynciv.xhtml Bufsize is in integers, not bytes. The current code overflows data unto other stack variables.
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index aadc71c5b8..9c6e6baaec 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -115,7 +115,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
if (state.canvas_instance_data_buffers[state.current_data_buffer_index].fence != GLsync()) {
GLint syncStatus;
- glGetSynciv(state.canvas_instance_data_buffers[state.current_data_buffer_index].fence, GL_SYNC_STATUS, sizeof(GLint), nullptr, &syncStatus);
+ glGetSynciv(state.canvas_instance_data_buffers[state.current_data_buffer_index].fence, GL_SYNC_STATUS, 1, nullptr, &syncStatus);
if (syncStatus == GL_UNSIGNALED) {
// If older than 2 frames, wait for sync OpenGL can have up to 3 frames in flight, any more and we need to sync anyway.
if (state.canvas_instance_data_buffers[state.current_data_buffer_index].last_frame_used < RSG::rasterizer->get_frame_number() - 2) {