gl: Avoid null deref

This commit is contained in:
kd-11 2017-11-22 18:45:26 +03:00
parent 4d75e98647
commit 75d0ff177d
2 changed files with 3 additions and 6 deletions

View File

@ -473,14 +473,13 @@ void GLGSRender::end()
if (g_cfg.video.strict_rendering_mode)
{
if (ds->old_contents != nullptr)
if (ds && ds->old_contents != nullptr)
copy_rtt_contents(ds);
for (auto &rtt : m_rtts.m_bound_render_targets)
{
if (std::get<0>(rtt) != 0)
if (auto surface = std::get<1>(rtt))
{
auto surface = std::get<1>(rtt);
if (surface->old_contents != nullptr)
copy_rtt_contents(surface);
}

View File

@ -1383,10 +1383,8 @@ void VKGSRender::end()
//Prepare surfaces if needed
for (auto &rtt : m_rtts.m_bound_render_targets)
{
if (std::get<0>(rtt) != 0)
if (auto surface = std::get<1>(rtt))
{
auto surface = std::get<1>(rtt);
if (surface->old_contents != nullptr)
copy_rtt_contents(surface);
}