From c6d7c8f601dea3f2be16791a9386c51f2269c2f7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 16 Oct 2022 22:14:46 -0700 Subject: [PATCH] Qt: Fix e-Reader scanning function reentry (fixes #2693) --- CHANGES | 1 + src/platform/qt/CoreController.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f4a1bc032..93418919c 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Other fixes: - Qt: Manually split filename to avoid overzealous splitting (fixes mgba.io/i/2681) - Qt: Expand criteria for tag branch names (fixes mgba.io/i/2679) + - Qt: Fix scanning specific e-Reader dotcodes (fixes mgba.io/i/2693) - Res: Fix species name location in Ruby/Sapphire revs 1/2 (fixes mgba.io/i/2685) 0.10.0: (2022-10-11) diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index 61774de71..37fc1b01f 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -914,7 +914,10 @@ void CoreController::scanCard(const QString& path) { if (!file.open(QIODevice::ReadOnly)) { return; } - m_eReaderData = file.read(2912); + QByteArray eReaderData = file.read(2912); + if (eReaderData.isEmpty()) { + return; + } file.seek(0); QStringList lines; @@ -936,6 +939,7 @@ void CoreController::scanCard(const QString& path) { } } scanCards(lines); + m_eReaderData = eReaderData; } else if (image.size() == QSize(989, 44) || image.size() == QSize(639, 44)) { const uchar* bits = image.constBits(); size_t size;