mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crashes when looking up info in No-Intro DB
This commit is contained in:
parent
dc00c41855
commit
5bd0bacb8b
|
@ -70,7 +70,7 @@ ROMInfo::ROMInfo(GameController* controller, QWidget* parent)
|
||||||
if (crc32) {
|
if (crc32) {
|
||||||
m_ui.crc->setText(QString::number(crc32, 16));
|
m_ui.crc->setText(QString::number(crc32, 16));
|
||||||
if (db) {
|
if (db) {
|
||||||
NoIntroGame game;
|
NoIntroGame game{};
|
||||||
if (NoIntroDBLookupGameByCRC(db, crc32, &game)) {
|
if (NoIntroDBLookupGameByCRC(db, crc32, &game)) {
|
||||||
m_ui.name->setText(game.name);
|
m_ui.name->setText(game.name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -735,7 +735,7 @@ void Window::updateTitle(float fps) {
|
||||||
m_controller->threadInterrupt();
|
m_controller->threadInterrupt();
|
||||||
if (m_controller->isLoaded()) {
|
if (m_controller->isLoaded()) {
|
||||||
const NoIntroDB* db = GBAApp::app()->gameDB();
|
const NoIntroDB* db = GBAApp::app()->gameDB();
|
||||||
NoIntroGame game;
|
NoIntroGame game{};
|
||||||
uint32_t crc32 = 0;
|
uint32_t crc32 = 0;
|
||||||
|
|
||||||
switch (m_controller->thread()->core->platform(m_controller->thread()->core)) {
|
switch (m_controller->thread()->core->platform(m_controller->thread()->core)) {
|
||||||
|
@ -758,7 +758,7 @@ void Window::updateTitle(float fps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (db && crc32) {
|
if (db && crc32) {
|
||||||
NoIntroDBLookupGameByCRC(db, crc32, &game);
|
NoIntroDBLookupGameByCRC(db, crc32, &game);
|
||||||
title = QLatin1String(game.name);
|
title = QLatin1String(game.name);
|
||||||
} else {
|
} else {
|
||||||
char gameTitle[17] = { '\0' };
|
char gameTitle[17] = { '\0' };
|
||||||
|
|
Loading…
Reference in New Issue