From 6a2e6ecbc5c9be286b6c87731182c10259fd4a07 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 27 Mar 2024 10:32:26 +0100 Subject: [PATCH] GL: fix segfault in GLGSRender::flip --- rpcs3/Emu/RSX/GL/GLPresent.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index 5cccb8d3cfcf..b46ac3e154e9 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -341,8 +341,21 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) } } + if (!image_to_flip2) + { + images.resize(1u); + } + gl::screen.bind(); - m_video_output_pass.run(cmd, areau(aspect_ratio), images.map(FN(x->id())), gamma, limited_range, avconfig.stereo_mode, filter); + + auto mapped = images.map(FN(x->id())); + + if (mapped.size() == 1) + { + mapped.push_back(GL_NONE); + } + + m_video_output_pass.run(cmd, areau(aspect_ratio), mapped, gamma, limited_range, avconfig.stereo_mode, filter); } }