Check Exiv2::ValueType::typeId before converting it to rational
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 / D18010: Fix failing test of exiv gps data
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.
Reviewers: Baloo, Frameworks, astippich, ngraham
Reviewed By: Baloo, ngraham
Subscribers: kde-frameworks-devel, Baloo
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D18688