D16165: Don't crash on invalid exiv2 data

Igor Poboiko noreply at phabricator.kde.org
Fri Oct 12 20:12:43 BST 2018


poboiko created this revision.
poboiko added reviewers: Baloo, Frameworks.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
poboiko requested review of this revision.

REVISION SUMMARY
  The file from bug 375131 crashes `baloo_file_extractor`. The problem is that its EXIF data
  contains a key `Exif.Photo.FocalLength`, whose type is `Exiv2::unsignedRational`, and with no value.
  Inside Exiv2, when we try call `toFloat()` on it, it tries to look for two numbers inside `value`,
  finds none and crashes.
  This is simple workaround: if we got a property with no value, just return an empty QVariant().
  
  (unfortunately, didn't manage to reproduce the hang reported in the bug originally)
  
  CCBUG: 375131

TEST PLAN
  `baloo_file_extractor` no longer crashes on the file, it processes the file and extracts all the necessary data

REPOSITORY
  R286 KFileMetaData

BRANCH
  dont-crash-invalid-exiv (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D16165

AFFECTED FILES
  src/extractors/exiv2extractor.cpp

To: poboiko, #baloo, #frameworks
Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181012/130483a3/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list