[SCM] gwenview packaging branch, master, updated. debian/4.8.4-1-2-g4cc4c31

Pino Toscano pino at alioth.debian.org
Tue Jun 26 13:22:41 UTC 2012


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-sc/gwenview.git;a=commitdiff;h=4cc4c31

The following commit has been merged in the master branch:
commit 4cc4c3121c4fb94f0c729d5163f8a762050c2bc6
Author: Pino Toscano <pino at debian.org>
Date:   Tue Jun 26 15:22:04 2012 +0200

    fix crash when gathering meta info
    
    ... by catching Exiv2 exceptions
    backport upstream commit 05511b41913904c36bfd2cccc888ac4c466784f1
---
 debian/changelog                                   |    4 +
 debian/patches/series                              |    1 +
 ...tions-from-Exiv2-when-gathering-meta-info.patch |   84 ++++++++++++++++++++
 3 files changed, 89 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d5519d7..a6f609a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 gwenview (4:4.8.4-2) UNRELEASED; urgency=low
 
+  [ Pino Toscano ]
+  * Backport upstream commit 05511b41913904c36bfd2cccc888ac4c466784f1 to fix
+    crash when gathering meta info by catching Exiv2 exceptions; patch
+    upstream_Catch-exceptions-from-Exiv2-when-gathering-meta-info.patch.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Tue, 26 Jun 2012 15:17:19 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4bc0240
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+upstream_Catch-exceptions-from-Exiv2-when-gathering-meta-info.patch
diff --git a/debian/patches/upstream_Catch-exceptions-from-Exiv2-when-gathering-meta-info.patch b/debian/patches/upstream_Catch-exceptions-from-Exiv2-when-gathering-meta-info.patch
new file mode 100644
index 0000000..4529b0b
--- /dev/null
+++ b/debian/patches/upstream_Catch-exceptions-from-Exiv2-when-gathering-meta-info.patch
@@ -0,0 +1,84 @@
+From 05511b41913904c36bfd2cccc888ac4c466784f1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= <agateau at kde.org>
+Date: Tue, 26 Jun 2012 14:36:17 +0200
+Subject: [PATCH] Catch exceptions from Exiv2 when gathering meta info
+
+Since Exiv2 0.23, ExifDatum::tagLabel() can throw
+
+BUG: 302350
+---
+ lib/CMakeLists.txt                        |    1 +
+ lib/exiv2imageloader.h                    |    4 +-
+ lib/imagemetainfomodel.cpp                |   33 ++++++++--------
+ tests/auto/CMakeLists.txt                 |    1 +
+ tests/auto/imagemetainfomodeltest.cpp     |   58 +++++++++++++++++++++++++++++
+ tests/auto/imagemetainfomodeltest.h       |   38 +++++++++++++++++++
+ tests/data/302350_exiv_0.23_exception.jpg |  Bin 0 -> 122659 bytes
+ 7 files changed, 119 insertions(+), 16 deletions(-)
+ create mode 100644 tests/auto/imagemetainfomodeltest.cpp
+ create mode 100644 tests/auto/imagemetainfomodeltest.h
+ create mode 100644 tests/data/302350_exiv_0.23_exception.jpg
+
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index fad758a..88234be 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -163,6 +163,7 @@ endif (GWENVIEW_SEMANTICINFO_BACKEND_NEPOMUK)
+ 
+ set_source_files_properties(
+     exiv2imageloader.cpp
++    imagemetainfomodel.cpp
+     PROPERTIES
+     COMPILE_FLAGS "${KDE4_ENABLE_EXCEPTIONS}"
+     )
+diff --git a/lib/imagemetainfomodel.cpp b/lib/imagemetainfomodel.cpp
+index 85b602c..fd86055 100644
+--- a/lib/imagemetainfomodel.cpp
++++ b/lib/imagemetainfomodel.cpp
+@@ -262,25 +262,28 @@ struct ImageMetaInfoModelPrivate
+         it = container.begin(),
+         end = container.end();
+ 
+-        if (it == end) {
+-            return;
+-        }
+-
+         for (; it != end; ++it) {
+-            QString key = QString::fromUtf8(it->key().c_str());
+-            QString label = QString::fromLocal8Bit(it->tagLabel().c_str());
+-            std::ostringstream stream;
+-            stream << *it;
+-            QString value = QString::fromLocal8Bit(stream.str().c_str());
+-
+-            EntryHash::iterator hashIt = hash.find(key);
+-            if (hashIt != hash.end()) {
+-                hashIt.value()->appendValue(value);
+-            } else {
+-                hash.insert(key, new MetaInfoGroup::Entry(key, label, value));
++            try {
++                QString key = QString::fromUtf8(it->key().c_str());
++                QString label = QString::fromLocal8Bit(it->tagLabel().c_str());
++                std::ostringstream stream;
++                stream << *it;
++                QString value = QString::fromLocal8Bit(stream.str().c_str());
++
++                EntryHash::iterator hashIt = hash.find(key);
++                if (hashIt != hash.end()) {
++                    hashIt.value()->appendValue(value);
++                } else {
++                    hash.insert(key, new MetaInfoGroup::Entry(key, label, value));
++                }
++            } catch (const Exiv2::Error& error) {
++                kWarning() << "Failed to read some meta info:" << error.what();
+             }
+         }
+ 
++        if (hash.isEmpty()) {
++            return;
++        }
+         q->beginInsertRows(parent, 0, hash.size() - 1);
+         Q_FOREACH(MetaInfoGroup::Entry * entry, hash) {
+             group->addEntry(entry);
+-- 
+1.7.10
+

-- 
gwenview packaging



More information about the pkg-kde-commits mailing list