Adding values to a repeatable IPTC tag segfaults

Bug #510392 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyexiv2
Fix Released
High
Olivier Tilloy

Bug Description

This happens with pyexiv2 0.2 (development branch) compiled against libexiv2 0.19.

Adding a value to a repeatable IPTC tag (or setting the value of a repeatable IPTC tag to an non-empty list that contains more elements than the previous value) raises a segmentation fault. Test script to reproduce:

import pyexiv2
m = pyexiv2.ImageMetadata('image.jpg')
m.read()
key = 'Iptc.Application2.Keywords'

# If the tag is not present in the image:
m[key] = pyexiv2.IptcTag(key, ['one'])

# Or if the tag is present with, say, two values:
m[key].values = ['one', 'two', 'three']

# This also segfaults:
m[key].values.append('more')

Note that setting the value to the empty list behaves as expected (and doesn't raise a segmentation fault): after writing back the metadata, the tag is not present in the image any longer. Setting the value to the empty list when the tag was not previously present also works.

Tags: iptc

Related branches

Olivier Tilloy (osomon)
Changed in pyexiv2:
status: Confirmed → Fix Committed
Olivier Tilloy (osomon)
Changed in pyexiv2:
status: Fix Committed → Fix Released
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.