Merge lp:~om26er/ubuntu/maverick/gexiv2/gexiv2-fix-636161 into lp:ubuntu/maverick/gexiv2

Proposed by Omer Akram on 2010-11-20
Status: Merged
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~om26er/ubuntu/maverick/gexiv2/gexiv2-fix-636161
Merge into: lp:ubuntu/maverick/gexiv2
Diff against target: 70 lines (+42/-0)
4 files modified
debian/changelog (+7/-0)
debian/patches/do_not_crash_when_importing_images.patch (+22/-0)
debian/patches/series (+1/-0)
gexiv2/gexiv2-metadata.cpp (+12/-0)
To merge this branch: bzr merge lp:~om26er/ubuntu/maverick/gexiv2/gexiv2-fix-636161
Reviewer Review Type Date Requested Status
Michael Vogt 2010-11-20 Approve on 2010-11-25
Review via email: mp+41398@code.launchpad.net

Description of the Change

backporting the fix from upstream svn

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Thanks for your branch and for getting this fix from upstream!

I will upload the fix now, it would be nice if you could add a TEST CASE to the bugreport.
If there is no link to a picture file available that fails I think we just need to add
a generic "test for regressions" fix and/or ask the original reporter to test.

I would also like to modify the changelog description a little bit as the bug is about
a specific format, not about a mass import (that is just where the problem manifests
itself). But I'm happy to change that myself in the changelog.

review: Approve
Michael Vogt (mvo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-08-23 10:18:25 +0000
3+++ debian/changelog 2010-11-20 14:01:34 +0000
4@@ -1,3 +1,10 @@
5+gexiv2 (0.2.0-0ubuntu2.1) maverick-proposed; urgency=low
6+
7+ * debian/patches/do_not_crash_when_importing_images.patch:
8+ - do not crash when importing large amount of images (LP: #636161)
9+
10+ -- Omer Akram <om26er@ubuntu.com> Sat, 20 Nov 2010 15:15:16 +0500
11+
12 gexiv2 (0.2.0-0ubuntu2) maverick; urgency=low
13
14 * debian/libgexiv2-dev.install:
15
16=== added directory 'debian/patches'
17=== added file 'debian/patches/do_not_crash_when_importing_images.patch'
18--- debian/patches/do_not_crash_when_importing_images.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/do_not_crash_when_importing_images.patch 2010-11-20 14:01:34 +0000
20@@ -0,0 +1,22 @@
21+diff -ruN a//gexiv2/gexiv2-metadata.cpp b//gexiv2/gexiv2-metadata.cpp
22+--- a//gexiv2/gexiv2-metadata.cpp 2010-08-21 04:07:07.000000000 +0500
23++++ b//gexiv2/gexiv2-metadata.cpp 2010-11-20 13:03:21.215636605 +0500
24+@@ -505,6 +505,18 @@
25+
26+ Exiv2::ExifKey std_key ("Exif.Image.Orientation");
27+ it = exif_data.findKey (std_key);
28++
29++ // TODO: This was added in response to http://trac.yorba.org/ticket/2514
30++ // The user supplied a file to us with two Exif.Image.Orientation fields, one reported (the
31++ // first) as zero by exiv2. I discovered that field has a count() of zero, or is emtpy,
32++ // which causes a segfault when the iterator is dereferenced.
33++ //
34++ // This searches for the first matching non-empty key. A better solution would be to guard
35++ // against this in all searches for all domains, but that's too much of a change for now.
36++ // We'll probably need to do this for the next release.
37++ while (it != exif_data.end() && it->count() == 0)
38++ it++;
39++
40+ if (it != exif_data.end ()) {
41+ GExiv2Orientation orientation = (GExiv2Orientation) it->toLong ();
42+
43
44=== added file 'debian/patches/series'
45--- debian/patches/series 1970-01-01 00:00:00 +0000
46+++ debian/patches/series 2010-11-20 14:01:34 +0000
47@@ -0,0 +1,1 @@
48+do_not_crash_when_importing_images.patch
49
50=== modified file 'gexiv2/gexiv2-metadata.cpp'
51--- gexiv2/gexiv2-metadata.cpp 2010-06-30 00:41:43 +0000
52+++ gexiv2/gexiv2-metadata.cpp 2010-11-20 14:01:34 +0000
53@@ -505,6 +505,18 @@
54
55 Exiv2::ExifKey std_key ("Exif.Image.Orientation");
56 it = exif_data.findKey (std_key);
57+
58+ // TODO: This was added in response to http://trac.yorba.org/ticket/2514
59+ // The user supplied a file to us with two Exif.Image.Orientation fields, one reported (the
60+ // first) as zero by exiv2. I discovered that field has a count() of zero, or is emtpy,
61+ // which causes a segfault when the iterator is dereferenced.
62+ //
63+ // This searches for the first matching non-empty key. A better solution would be to guard
64+ // against this in all searches for all domains, but that's too much of a change for now.
65+ // We'll probably need to do this for the next release.
66+ while (it != exif_data.end() && it->count() == 0)
67+ it++;
68+
69 if (it != exif_data.end ()) {
70 GExiv2Orientation orientation = (GExiv2Orientation) it->toLong ();
71

Subscribers

People subscribed via source and target branches

to all changes: