Sfoglia il codice sorgente

gl_buffer_cache: Use glClearNamedBufferSubData:GL_RED instead of GL_RGBA

Avoids reading out of bounds from the stack.
ReinUsesLisp 5 anni fa
parent
commit
a0c4557557
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/video_core/renderer_opengl/gl_buffer_cache.cpp

+ 1 - 1
src/video_core/renderer_opengl/gl_buffer_cache.cpp

@@ -100,7 +100,7 @@ void BufferCacheRuntime::CopyBuffer(Buffer& dst_buffer, Buffer& src_buffer,
 
 void BufferCacheRuntime::ClearBuffer(Buffer& dest_buffer, u32 offset, size_t size, u32 value) {
     glClearNamedBufferSubData(dest_buffer.Handle(), GL_R32UI, static_cast<GLintptr>(offset),
-                              static_cast<GLsizeiptr>(size / sizeof(u32)), GL_RGBA, GL_UNSIGNED_INT,
+                              static_cast<GLsizeiptr>(size / sizeof(u32)), GL_RED, GL_UNSIGNED_INT,
                               &value);
 }