D18688: Check Exiv2::ValueType::typeId before converting it to rational

Igor Poboiko noreply at phabricator.kde.org
Sat Feb 2 21:48:01 GMT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190202/c8ce09a0/attachment.html>


More information about the Kde-frameworks-devel mailing list