Bug #739

exiv2 crashes when examining previews

Added by Jim Nelson about 11 years ago. Updated almost 11 years ago.

Target version:
Start date:
05 Nov 2010
Due date:
% Done:


Estimated time:


A user has supplied me with a photo that causes Exiv2's preview manager to crash at initialization. The stack trace is attached. The segfault happens here:

#0 0x00277314 in Exiv2::DataValue::toLong (this=0x8088a50, n=0)
at value.cpp:246

It's easily reproducible using this command:

$ exiv2 -pp <filename>@

The user has asked I not share the photo publicly. I can make it available to any developer who's going to work through this problem. Just email me at .

This bug is a big problem for Shotwell and gexiv2, as the preview manager is initialized whenever an image is loaded.


exiv2.dump (3.23 KB) exiv2.dump Jim Nelson, 05 Nov 2010 12:41
bug739.patch (4.03 KB) bug739.patch Changes checked in with r2375 Andreas Huggel, 06 Nov 2010 08:01

Associated revisions

Revision 2375 (diff)
Added by Andreas Huggel about 11 years ago

#739: Protect access to toLong() in preview.cpp.



Updated by Jim Nelson about 11 years ago

Our ticket for this problem is here:


Updated by Andreas Huggel about 11 years ago

Indeed, there are several unprotected toLong() calls in this area. The same problem we discussed some time ago, only this time in the library itself.

Can you please try if r2375 solves the problem? If it helps, you can apply the attached patch to a recent version of exiv2, which will let you compile a binary compatible library.


Updated by Jim Nelson about 11 years ago

That works!

Any idea when 0.21 will be released?


Updated by Andreas Huggel about 11 years ago

  • Category set to exif
  • Status changed from New to Resolved
  • Assignee set to Andreas Huggel
  • Target version set to 0.21
  • % Done changed from 0 to 100

Thanks for the feedback. I plan to release 0.21 this month.


Updated by Andreas Huggel almost 11 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF