From f7691ebe57d083f12969b5e186154a301f7bfae1 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 5 Jul 2019 23:49:45 -0300 Subject: gl_rasterizer: Fix nullptr dereference on disabled buffers --- src/video_core/renderer_opengl/gl_buffer_cache.h | 4 ++-- src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/video_core/renderer_opengl') diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h index 3befdc6ab..8c8ac4038 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.h +++ b/src/video_core/renderer_opengl/gl_buffer_cache.h @@ -27,13 +27,13 @@ public: std::size_t stream_size); ~OGLBufferCache(); + const GLuint* GetEmptyBuffer(std::size_t) override; + protected: OGLBuffer CreateBuffer(std::size_t size) override; const GLuint* ToHandle(const OGLBuffer& buffer) override; - const GLuint* GetEmptyBuffer(std::size_t) override; - void UploadBufferData(const OGLBuffer& buffer, std::size_t offset, std::size_t size, const u8* data) override; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b8430f16d..0bb5c068c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -788,7 +788,7 @@ void RasterizerOpenGL::SetupConstBuffer(const Tegra::Engines::ConstBufferInfo& b const GLShader::ConstBufferEntry& entry) { if (!buffer.enabled) { // Set values to zero to unbind buffers - bind_ubo_pushbuffer.Push(0, 0, 0); + bind_ubo_pushbuffer.Push(buffer_cache.GetEmptyBuffer(sizeof(float)), 0, sizeof(float)); return; } -- cgit v1.2.3