segfault on malformed exif tag

Bug #974809 reported by infinull on 2012-04-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyexiv2 (Ubuntu)

Bug Description

Test Image:

steps to reproduce:

Related branches

infinull (infinull) wrote :
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')
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.

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/
#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/
#3 0x00007ffff5f4a039 in exiv2wrapper::Image::getExifTag(std::string) ()
   from /home/osomon/dev/pyexiv2-branches/pyexiv2-0.3/build/

Changed in pyexiv2:
status: New → Confirmed
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
QB89Dragon (hughescih) wrote :

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

Olivier Tilloy (osomon) on 2014-10-24
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  Edit
Everyone can see this information.

Other bug subscribers