poboiko created this revision. poboiko added reviewers: Baloo, Frameworks, astippich. Herald added projects: Frameworks, Baloo. poboiko requested review of this revision.
REVISION SUMMARY If one has a malformed image with GPSAltitude key present, but is not rational, an attempt to convert it to rational will cause a crash. Same with GPSAltitudeRef key, (which is supposed to be a byte). This fixes regression introduced in D16617: fix extraction of GPS altitude for exif data <https://phabricator.kde.org/D16617> / D18010: Fix failing test of exiv gps data <https://phabricator.kde.org/D18010> TEST PLAN I have a picture that causes `baloo_file_extractor` to crash, with backtrace pointing to `toRational` call inside `fetchGpsAltitude`. It no longer crashes. Also, `ctest` doesn't report any oddities here. REPOSITORY R286 KFileMetaData BRANCH invalid-gps (branched from master) REVISION DETAIL https://phabricator.kde.org/D18688 AFFECTED FILES src/extractors/exiv2extractor.cpp To: poboiko, #baloo, #frameworks, astippich Cc: kde-frameworks-devel, #baloo, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams