<table><tr><td style="">poboiko created this revision.<br />poboiko added reviewers: Baloo, Frameworks.<br />Herald added projects: Frameworks, Baloo.<br />Herald added a subscriber: kde-frameworks-devel.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D16165">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The file from bug 375131 crashes <tt style="background: #ebebeb; font-size: 13px;">baloo_file_extractor</tt>. The problem is that its EXIF data<br />
contains a key <tt style="background: #ebebeb; font-size: 13px;">Exif.Photo.FocalLength</tt>, whose type is <tt style="background: #ebebeb; font-size: 13px;">Exiv2::unsignedRational</tt>, and with no value.<br />
Inside Exiv2, when we try call <tt style="background: #ebebeb; font-size: 13px;">toFloat()</tt> on it, it tries to look for two numbers inside <tt style="background: #ebebeb; font-size: 13px;">value</tt>,<br />
finds none and crashes.<br />
This is simple workaround: if we got a property with no value, just return an empty QVariant().</p>
<p>(unfortunately, didn't manage to reproduce the hang reported in the bug originally)</p>
<p>CCBUG: 375131</p></div></div><br /><div><strong>TEST PLAN</strong><div><p><tt style="background: #ebebeb; font-size: 13px;">baloo_file_extractor</tt> no longer crashes on the file, it processes the file and extracts all the necessary data</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R286 KFileMetaData</div></div></div><br /><div><strong>BRANCH</strong><div><div>dont-crash-invalid-exiv (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16165">https://phabricator.kde.org/D16165</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/extractors/exiv2extractor.cpp</div></div></div><br /><div><strong>To: </strong>poboiko, Baloo, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>