From 1069c890f51cf7b3aa9235918fadc41405851b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Fri, 14 Feb 2020 11:44:57 +0100 Subject: [PATCH] Incorporate FreeBSD fix from @mandree (#5651) plus a little hardening --- rtengine/imagedata.cc | 6 +++--- rtengine/procparams.cc | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 24cfefde9..a631a6c8d 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -502,11 +502,11 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* } else if (!make.compare (0, 6, "PENTAX") || (!make.compare (0, 5, "RICOH") && !model.compare (0, 6, "PENTAX"))) { // ISO at max value supported, check manufacturer specific if (iso_speed == 65535 || iso_speed == 0) { - rtexif::Tag* baseIsoTag = mnote->getTag("ISO"); + const rtexif::Tag* const baseIsoTag = mnote->getTag("ISO"); if (baseIsoTag) { - std::string isoData = baseIsoTag->valueToString(); + const std::string isoData = baseIsoTag->valueToString(); if (isoData.size() > 1) { - iso_speed = stoi(isoData); + iso_speed = std::stoi(isoData); } } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f53b4c513..f6b139550 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -4606,8 +4606,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) Glib::ustring temp; assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, temp, pedited->wavelet.Lmethod); - if (!temp.empty()) { + try { wavelet.Lmethod = std::stoi(temp); + } catch (...) { } } else { assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod);