From ff44b56a701df287eefdcbbb3a5711034a64d934 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Wed, 4 Apr 2018 09:08:00 -0700 Subject: [PATCH] Fix crash when image count is less than trigger count --- src/AnalyzeView/GeoTagController.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AnalyzeView/GeoTagController.cc b/src/AnalyzeView/GeoTagController.cc index 33ee123fc..2db65e718 100644 --- a/src/AnalyzeView/GeoTagController.cc +++ b/src/AnalyzeView/GeoTagController.cc @@ -259,6 +259,11 @@ void GeoTagWorker::run(void) int maxIndex = std::min(_imageIndices.count(), _triggerIndices.count()); maxIndex = std::min(maxIndex, _imageList.count()); for(int i = 0; i < maxIndex; i++) { + int imageIndex = _imageIndices[i]; + if (imageIndex >= _imageList.count()) { + emit error(tr("Geotagging failed. Image requested not present.")); + return; + } QFile fileRead(_imageList.at(_imageIndices[i]).absoluteFilePath()); if (!fileRead.open(QIODevice::ReadOnly)) { emit error(tr("Geotagging failed. Couldn't open an image.")); -- 2.22.0