From f76c7f3788242e8b486c51cd251e6c59179e33dd Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Tue, 6 Dec 2022 20:37:53 +0100 Subject: LibGL: Generate GL_OUT_OF_MEMORY error in `glBufferData` when OOM --- Userland/Libraries/LibGL/Buffer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGL/Buffer.cpp b/Userland/Libraries/LibGL/Buffer.cpp index 2cd15423ec..b7d5676187 100644 --- a/Userland/Libraries/LibGL/Buffer.cpp +++ b/Userland/Libraries/LibGL/Buffer.cpp @@ -51,8 +51,7 @@ void GLContext::gl_buffer_data(GLenum target, GLsizeiptr size, void const* data, auto& target_buffer = target == GL_ELEMENT_ARRAY_BUFFER ? m_element_array_buffer : m_array_buffer; RETURN_WITH_ERROR_IF(!target_buffer, GL_INVALID_OPERATION); - // FIXME: Report GL_OUT_OF_MEMORY or other errors as needed here - MUST(target_buffer->set_data(data, size)); + RETURN_WITH_ERROR_IF(target_buffer->set_data(data, size).is_error(), GL_OUT_OF_MEMORY); } void GLContext::gl_buffer_sub_data(GLenum target, GLintptr offset, GLsizeiptr size, void const* data) -- cgit v1.2.3