From 065d52d98b40a5338d910c0329c1c63fe15da9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 7 Feb 2021 11:46:03 +0100 Subject: [PATCH] Propper error handling --- src/map/bsbmap.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/map/bsbmap.cpp b/src/map/bsbmap.cpp index a9eab1f7..1a801cd2 100644 --- a/src/map/bsbmap.cpp +++ b/src/map/bsbmap.cpp @@ -374,8 +374,7 @@ QImage BSBMap::readImage() if (!file.open(QIODevice::ReadOnly)) return QImage(); - file.seek(_dataOffset); - if (!file.getChar(&bits)) + if (!(file.seek(_dataOffset) && file.getChar(&bits))) return QImage(); QImage img(_size, QImage::Format_Indexed8);