segfault on malformed exif tag

Bug #974809 reported by infinull
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyexiv2
Fix Committed
High
Unassigned
pyexiv2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Test Image: http://dl.dropbox.com/u/4205401/1515.jpg

steps to reproduce:

Related branches

Revision history for this message
infinull (infinull) wrote :
Revision history for this message
infinull (infinull) wrote :

Oops, I meant to just attach the file, now I can't edit the bug body.

Anyway, when you opening the image file I attached (and linked), and you try to access tag with key Exif.Image.0x0001, you will get a segfault (probably should just throw an exception about malformed metadata)

Steps to reproduce
md = pyexiv2.ImageMetadata('1515.jpg')
md.read()
t = md['Exif.Image.0x0001'] #segfaults

exiv2 command line outputs this warning:
Warning: Directory Image, entry 0x0001 has unknown Exif (TIFF) type 0; setting type size 1.

Thanks for any help.

Revision history for this message
Olivier Tilloy (osomon) wrote :

I can reproduce the segmentation fault with the sample photo attached and pyexiv2 trunk compiled against libexiv2 0.21.1.
Here is the top of the backtrace:

#0 Py_Main (argc=0, argv=0x0) at ../Modules/main.c:503
#1 0x00007ffff55d35ec in std::string::operator=(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x00007ffff5f4b918 in exiv2wrapper::ExifTag::ExifTag(std::string const&, Exiv2::Exifdatum*, Exiv2::ExifData*, Exiv2::ByteOrder) ()
   from /home/osomon/dev/pyexiv2-branches/pyexiv2-0.3/build/libexiv2python.so
#3 0x00007ffff5f4a039 in exiv2wrapper::Image::getExifTag(std::string) ()
   from /home/osomon/dev/pyexiv2-branches/pyexiv2-0.3/build/libexiv2python.so

Changed in pyexiv2:
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

Fixed at revision 375 of trunk.

Changed in pyexiv2:
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → High
status: Confirmed → Fix Committed
Revision history for this message
QB89Dragon (hughescih) wrote :

Any chance we can see this fixed in Ubuntu 12.10 server without compiling manually?

Olivier Tilloy (osomon)
Changed in pyexiv2 (Ubuntu):
status: New → Confirmed
Changed in pyexiv2:
assignee: Olivier Tilloy (osomon) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.