Qt: Fix crash on invalid ROM loads
Jeffrey Pfau jeffrey@endrift.com
Sun, 21 Feb 2016 12:57:31 -0800
1 files changed,
10 insertions(+),
7 deletions(-)
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -306,6 +306,16 @@ if (biosOnly && (!m_useBios || m_bios.isNull())) {
return; } + if (!biosOnly) { + m_threadContext.core = mCoreFind(m_fname.toUtf8().constData()); + } else { + m_threadContext.core = GBACoreCreate(); + } + + if (!m_threadContext.core) { + return; + } + m_gameOpen = true; m_pauseAfterFrame = false;@@ -316,13 +326,6 @@ m_threadContext.sync.audioWait = false;
} else { m_threadContext.sync.videoFrameWait = m_videoSync; m_threadContext.sync.audioWait = m_audioSync; - } - - - if (!biosOnly) { - m_threadContext.core = mCoreFind(m_fname.toUtf8().constData()); - } else { - m_threadContext.core = GBACoreCreate(); } m_threadContext.core->init(m_threadContext.core);