Bug 345169

Summary: Incorrect method of parsing metadata from MP4 files (leads to hangs with current libexiv2)
Product: [Applications] gwenview Reporter: Vitaliy Filippov <vitalif>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: home1, myriam, nate
Priority: NOR    
Version: Other (add details in bug description)   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Vitaliy Filippov 2015-03-15 08:28:40 UTC
Hi!
I'm using gwenview 4.14.0 pre (from debian unstable).
I've discovered it uses exiv2::MemIO on the first 64Kbytes of video files (including MP4) to parse metadata.
But, this method is incorrect - MP4 may have metadata in any position! In fact, the default layout for MP4 is with metadata IN THE END! So it can't be parsed from the first 64Kbytes.
Moreover, it leads to HANGS on current versions of exiv2 - it wasn't expecting truncated files and basically performed an infinite loop on them.
Specifically, I had to patch libexiv2 and send the patch upstream (http://dev.exiv2.org/issues/1038) to make Gwenview read a folder with video files from my mobile phone.
And the bug also happens on truncated AVI files...
Of course libexiv2 shouldn't crash or hang regardless of the input file validity... but Gwenview's method of parsing metadata is still incorrect.

Reproducible: Always
Comment 1 jack_sprat 2016-08-19 10:17:52 UTC
I can confirm this bug: Gwenview4.14.3-4.3.i586 under OpenSuse 13.2 i586

Gwenview hangs if folder contains either MP4 or AVI files, but is fine with MOV (and JPG)
Comment 2 Nate Graham 2017-09-08 18:57:02 UTC
I've seen quite a lot of bugs related to bad versions of libexiv2. They've all been resolved with newer versions of that library. Can you confirm?