gl: Avoid null deref

This commit is contained in:
kd-11 2017-11-22 18:45:26 +03:00
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 (g_cfg.video.strict_rendering_mode)
{ {
if (ds->old_contents != nullptr) if (ds && ds->old_contents != nullptr)
copy_rtt_contents(ds); copy_rtt_contents(ds);
for (auto &rtt : m_rtts.m_bound_render_targets) 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) if (surface->old_contents != nullptr)
copy_rtt_contents(surface); copy_rtt_contents(surface);
} }

View file

@ -1383,10 +1383,8 @@ void VKGSRender::end()
//Prepare surfaces if needed //Prepare surfaces if needed
for (auto &rtt : m_rtts.m_bound_render_targets) 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) if (surface->old_contents != nullptr)
copy_rtt_contents(surface); copy_rtt_contents(surface);
} }